summaryrefslogtreecommitdiff
path: root/clientserver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-06-04 12:08:18 -0700
committerWayne Davison <wayned@samba.org>2011-06-04 12:08:18 -0700
commite3bc529de9b7d0e98c492677f73a8127a1d74d35 (patch)
treec9aba3607a19f7be87604611bdc41f3e4191bc8c /clientserver.c
parent820f7a7b57c566f8f1fb25e7e9a96542d2d8c4aa (diff)
downloadrsync-e3bc529de9b7d0e98c492677f73a8127a1d74d35.tar.gz
Handle EINTR when reading the pre-xfer exec message.
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clientserver.c b/clientserver.c
index 8fedbe66..91612ea0 100644
--- 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. */
- 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--;