From: Wayne Davison Date: Thu, 3 Jan 2008 01:20:44 +0000 (-0800) Subject: Made read_arg_from_pipe() handle EINTR. X-Git-Tag: v3.0.0pre8~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62a6b8df72d18f0b13462ee7ac33f9a8a46ef0b5;p=thirdparty%2Frsync.git Made read_arg_from_pipe() handle EINTR. --- diff --git a/clientserver.c b/clientserver.c index cb17438b..1e3af63a 100644 --- a/clientserver.c +++ b/clientserver.c @@ -355,8 +355,12 @@ static int read_arg_from_pipe(int fd, char *buf, int limit) char *bp = buf, *eob = buf + limit - 1; while (1) { - if (read(fd, bp, 1) != 1) + int got = read(fd, bp, 1); + if (got != 1) { + if (got < 0 && errno == EINTR) + continue; return -1; + } if (*bp == '\0') break; if (bp < eob)