Add backtrace to the appimage
authorArt Cancro <ajc@citadel.org>
Sun, 2 May 2021 20:43:41 +0000 (16:43 -0400)
committerArt Cancro <ajc@citadel.org>
Sun, 2 May 2021 20:43:41 +0000 (16:43 -0400)
appimage/ctdlvisor.c

index 6784f2c..c7a073a 100644 (file)
@@ -96,12 +96,14 @@ void detach_from_tty(void) {
 
 pid_t start_citadel() {
        char bin[1024];
+       char backtrace_filename[PATH_MAX];
        sprintf(bin, "%s/usr/local/citadel/citserver", getenv("APPDIR"));
        pid_t pid = fork();
        if (pid == 0) {
                fprintf(stderr, "ctdlvisor: executing %s with data directory %s\n", bin, getenv("CTDL_DIR"));
                detach_from_tty();
-               execlp(bin, "citserver", "-x9", "-h", getenv("CTDL_DIR"), NULL);
+               sprintf(backtrace_filename, "/tmp/citserver-backtrace.%d", getpid());
+               execlp(bin, "citserver", "-x9", "-h", getenv("CTDL_DIR"), "-b", backtrace_filename, NULL);
                exit(errno);
        }
        else {