void buildCrashdump(char *filename) { char cmd[1024]; int ret; printf("%s: building crashdump from '%s'\n", __FUNCTION__, filename); snprintf(cmd, 1024, "gdb --batch --eval-command=\"bt ful\" arcemu-world %s &> crashdump.log", filename); ret = system(cmd); if (ret == 0) { char dstfile[1024]; ret = sendCrashdump(); if (ret == 0) { int rename_result = 0; snprintf(dstfile, 1024, "sent.%s", filename); rename_result = rename(filename, dstfile); if (rename_result == 0) printf("File successfully renamed"); else printf("Faild file renaming!"); } } else { fprintf(stderr, "%s: '%s' returned %d\n", __FUNCTION__, cmd, ret); } }
void buildCrashdump(char *filename) { char cmd[1024]; int ret; printf("%s: building crashdump from '%s'\n", __FUNCTION__, filename); snprintf(cmd, 1024, "gdb --batch --eval-command=\"bt ful\" wowice-world %s &> crashdump.log", filename); ret = system(cmd); if (ret == 0) { char dstfile[1024]; ret = sendCrashdump(); if (ret == 0) { snprintf(dstfile, 1024, "sent.%s", filename); rename(filename, dstfile); } } else { fprintf(stderr, "%s: '%s' returned %d\n", __FUNCTION__, cmd, ret); } }