X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Ftextclient%2Froutines2.c;h=caf7c9e17d097670224224dbe736b1cda4e7263c;hp=7282584f272c57f9d85ce8e4941d5d5d34dca5ef;hb=646e848010680ff99c345958338bcb8e1143d6dd;hpb=d6517e02c044dec3c209ccb1f1ac79ae96e5b5e0 diff --git a/citadel/textclient/routines2.c b/citadel/textclient/routines2.c index 7282584f2..caf7c9e17 100644 --- a/citadel/textclient/routines2.c +++ b/citadel/textclient/routines2.c @@ -313,7 +313,6 @@ void upload(CtdlIPC *ipc, int c) int xfer_pid; int a, b; FILE *fp, *lsfp; - int r; int rv; if ((room_flags & QR_UPLOAD) == 0) { @@ -342,6 +341,13 @@ void upload(CtdlIPC *ipc, int c) xfer_pid = fork(); if (xfer_pid == 0) { rv = chdir(tempdir); + if (rv < 0) { + scr_printf("failed to change into %s Reason %s\nAborting now.\n", + tempdir, + strerror(errno)); + nukedir(tempdir); + return; + } switch (c) { case 0: stty_ctdl(0); @@ -394,7 +400,7 @@ void upload(CtdlIPC *ipc, int c) flnm); newprompt(buf, desc, 150); snprintf(buf, sizeof buf, "%s/%s", tempdir, flnm); - r = CtdlIPCFileUpload(ipc, flnm, desc, buf, progress, tbuf); + CtdlIPCFileUpload(ipc, flnm, desc, buf, progress, tbuf); scr_printf("%s\n", tbuf); } pclose(lsfp);