From: Art Cancro Date: Mon, 11 Jan 2021 21:36:30 +0000 (+0000) Subject: trying to figure out why webcit doesn't chdir properly when run from appimage X-Git-Tag: v939~166 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=34b4acf39cd04a4370eba5806379003a0de48330 trying to figure out why webcit doesn't chdir properly when run from appimage --- diff --git a/appimage/ctdlvisor.c b/appimage/ctdlvisor.c index 63230afae..5f088de4e 100644 --- a/appimage/ctdlvisor.c +++ b/appimage/ctdlvisor.c @@ -42,10 +42,12 @@ pid_t start_citadel() { pid_t start_webcit() { char bin[1024]; sprintf(bin, "%s/usr/local/webcit/webcit", getenv("APPDIR")); + char wchome[1024]; + sprintf(wchome, "-h%s/usr/local/webcit", getenv("APPDIR")); pid_t pid = fork(); if (pid == 0) { printf("Executing %s\n", bin); - execlp(bin, "webcit", "-x9", "-p80", "uds", "/usr/local/citadel", NULL); + execlp(bin, "webcit", "-x9", wchome, "-p80", "uds", "/usr/local/citadel", NULL); perror("execlp"); exit(errno); } @@ -58,10 +60,12 @@ pid_t start_webcit() { pid_t start_webcits() { char bin[1024]; sprintf(bin, "%s/usr/local/webcit/webcit", getenv("APPDIR")); + char wchome[1024]; + sprintf(wchome, "-h%s/usr/local/webcit", getenv("APPDIR")); pid_t pid = fork(); if (pid == 0) { printf("Executing %s\n", bin); - execlp(bin, "webcit", "-x9", "-s", "-p443", "uds", "/usr/local/citadel", NULL); + execlp(bin, "webcit", "-x9", wchome, "-s", "-p443", "uds", "/usr/local/citadel", NULL); perror("execlp"); exit(errno); }