Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f27cd8
)
In copy_file(), check len < 0 before checking the close() return values.
author
Wayne Davison
<wayned@samba.org>
Tue, 27 Apr 2004 19:59:37 +0000
(19:59 +0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 27 Apr 2004 19:59:37 +0000
(19:59 +0000)
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
5129c35
..
9f28148
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-281,6
+281,14
@@
int copy_file(char *source, char *dest, mode_t mode)
}
}
+ if (len < 0) {
+ rprintf(FERROR, "read %s: %s\n",
+ full_fname(source), strerror(errno));
+ close(ifd);
+ close(ofd);
+ return -1;
+ }
+
if (close(ifd) < 0) {
rprintf(FINFO, "close failed on %s: %s\n",
full_fname(source), strerror(errno));
@@
-292,12
+300,6
@@
int copy_file(char *source, char *dest, mode_t mode)
return -1;
}
- if (len < 0) {
- rprintf(FERROR,"read %s: %s\n",
- full_fname(source), strerror(errno));
- return -1;
- }
-
return 0;
}