projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d62d3ec
)
cmd_read(): fseek just returns 0 on success, not the current offset.
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 14 Jun 2012 22:04:27 +0000
(
00:04
+0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 14 Jun 2012 22:04:27 +0000
(
00:04
+0200)
citadel/file_ops.c
patch
|
blob
|
history
diff --git
a/citadel/file_ops.c
b/citadel/file_ops.c
index 75670266b73d9a5aec9382d4ab9f18de5840b43c..a3e8d749859590c8ea035e51a59f9ab010ea71b0 100644
(file)
--- a/
citadel/file_ops.c
+++ b/
citadel/file_ops.c
@@
-610,8
+610,13
@@
void cmd_read(char *cmdbuf)
}
rc = fseek(CC->download_fp, start_pos, 0);
- if (rc
!= start_pos
) {
+ if (rc
< 0
) {
cprintf("%d your file is smaller then %ld.\n", ERROR + ILLEGAL_VALUE, start_pos);
+ syslog(LOG_ALERT, "your file %s is smaller then %ld. [%s]\n",
+ CC->upl_path,
+ start_pos,
+ strerror(errno));
+
return;
}
bytes = fread(buf, 1, bytes, CC->download_fp);