From 516eb9abe39cf49031bb1192232e6a49e96852fb Mon Sep 17 00:00:00 2001 From: Frank Cusack Date: Tue, 4 Mar 2003 05:37:22 +0000 Subject: [PATCH] safe_fork(): trap EINTR on pipe read --- pppd/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pppd/main.c b/pppd/main.c index a01b852..7b57a2a 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: main.c,v 1.123 2003/03/03 05:11:46 paulus Exp $" +#define RCSID "$Id: main.c,v 1.124 2003/03/04 05:37:22 fcusack Exp $" #include #include @@ -1428,7 +1428,9 @@ safe_fork() if (pid > 0) { close(pipefd[1]); /* this read() blocks until the close(pipefd[1]) below */ - read(pipefd[0], buf, 1); + while (read(pipefd[0], buf, 1) < 0) + if (errno != EINTR) + break; close(pipefd[0]); return pid; } -- 2.39.2