projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warnings all over citserver; handle function replies; remove unused code.
[citadel.git]
/
citadel
/
file_ops.c
diff --git
a/citadel/file_ops.c
b/citadel/file_ops.c
index bb5e985a6c0e5c866f2207bb01db71dbd4475b9f..3bb6da1d8fc9962ec5048c94a334e0fd3d66c472 100644
(file)
--- 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);
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));
}
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);
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);
}
free(buf);
}