X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Ffile_ops.c;h=3bb6da1d8fc9962ec5048c94a334e0fd3d66c472;hb=976ecc57b694ee60412d9b4a1be2fd07611d4ee2;hp=bb5e985a6c0e5c866f2207bb01db71dbd4475b9f;hpb=feb542114454b1f979c025ede9474f53b6715bce;p=citadel.git diff --git a/citadel/file_ops.c b/citadel/file_ops.c index bb5e985a6..3bb6da1d8 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -373,6 +373,12 @@ void cmd_oimg(char *cmdbuf) return; } rv = fread(&MimeTestBuf[0], 1, 32, CC->download_fp); + if (rv == -1) { + cprintf("%d Cannot access %s: %s\n", + ERROR + FILE_NOT_FOUND, pathname, strerror(errno)); + return; + } + rewind (CC->download_fp); OpenCmdResult(pathname, GuessMimeType(&MimeTestBuf[0], 32)); } @@ -706,6 +712,10 @@ void cmd_writ(char *cmdbuf) buf = malloc(bytes + 1); client_read(buf, bytes); rv = fwrite(buf, bytes, 1, CC->upload_fp); + if (rv == -1) { + syslog(LOG_EMERG, "Couldn't write: %s\n", + strerror(errno)); + } free(buf); }