summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2007-05-26 21:44:19 +0000
committerWayne Davison <wayned@samba.org>2007-05-26 21:44:19 +0000
commit47cffb77ded59e52e8af12cafd7407eb2844b119 (patch)
treeb93e68423467abde2a7ce8d8f0ed0a278da035ba /io.c
parent565a340b0a275faeff7b434ccf8bab98ff0d073d (diff)
downloadrsync-47cffb77ded59e52e8af12cafd7407eb2844b119.tar.gz
Handle EINTR in a couple places where we handle the --file-from I/O.
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/io.c b/io.c
index 897efc24..51b4ca30 100644
--- a/io.c
+++ b/io.c
@@ -677,7 +677,7 @@ static int read_timeout(int fd, char *buf, size_t len)
io_filesfrom_bp = io_filesfrom_buf;
else
io_filesfrom_bp += l;
- } else {
+ } else if (errno != EINTR) {
/* XXX should we complain? */
io_filesfrom_f_out = -1;
}
@@ -688,11 +688,13 @@ static int read_timeout(int fd, char *buf, size_t len)
io_filesfrom_buf,
sizeof io_filesfrom_buf);
if (l <= 0) {
- /* Send end-of-file marker */
- io_filesfrom_buf[0] = '\0';
- io_filesfrom_buf[1] = '\0';
- io_filesfrom_buflen = io_filesfrom_lastchar? 2 : 1;
- io_filesfrom_f_in = -1;
+ if (l == 0 || errno != EINTR) {
+ /* Send end-of-file marker */
+ io_filesfrom_buf[0] = '\0';
+ io_filesfrom_buf[1] = '\0';
+ io_filesfrom_buflen = io_filesfrom_lastchar? 2 : 1;
+ io_filesfrom_f_in = -1;
+ }
} else {
if (!eol_nulls) {
char *s = io_filesfrom_buf + l;