From 62a6b8df72d18f0b13462ee7ac33f9a8a46ef0b5 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 2 Jan 2008 17:20:44 -0800 Subject: [PATCH] Made read_arg_from_pipe() handle EINTR. --- clientserver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.34.1