From: Frank Cusack Date: Tue, 4 Mar 2003 05:37:22 +0000 (+0000) Subject: safe_fork(): trap EINTR on pipe read X-Git-Tag: ppp-2.4.7~319 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=516eb9abe39cf49031bb1192232e6a49e96852fb;p=ppp.git safe_fork(): trap EINTR on pipe read --- 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; }