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 (from parent 1:
820f7a7
)
Handle EINTR when reading the pre-xfer exec message.
author
Wayne Davison
<wayned@samba.org>
Sat, 4 Jun 2011 19:08:18 +0000
(12:08 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sat, 4 Jun 2011 19:08:18 +0000
(12:08 -0700)
clientserver.c
patch
|
blob
|
blame
|
history
diff --git
a/clientserver.c
b/clientserver.c
index
8fedbe6
..
91612ea
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-374,7
+374,14
@@
static char *finish_pre_exec(pid_t pid, int write_fd, int read_fd, char *request
/* Read the stdout from the pre-xfer exec program. This it is only
* displayed to the user if the script also returns an error status. */
/* Read the stdout from the pre-xfer exec program. This it is only
* displayed to the user if the script also returns an error status. */
- for (bp = buf; msglen > 0 && (j = read(read_fd, bp, msglen)) > 0; msglen -= j) {
+ for (bp = buf; msglen > 0; msglen -= j) {
+ if ((j = read(read_fd, bp, msglen)) <= 0) {
+ if (j == 0)
+ break;
+ if (errno == EINTR)
+ continue;
+ break; /* Just ignore the read error for now... */
+ }
bp += j;
if (j > 1 && bp[-1] == '\n' && bp[-2] == '\r') {
bp--;
bp += j;
if (j > 1 && bp[-1] == '\n' && bp[-2] == '\r') {
bp--;