X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-osf.c;h=a291a27d099cb78016b8fb6c727abf98be77906b;hp=9ee243473694cd6affc9df8e69dfde6bcbf6af80;hb=875d9641d05b4fcb7e186f784c801962bb2670e5;hpb=bad36b80e1fdff1ab1d45acbe9e5702bef496bab diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index 9ee2434..a291a27 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.26 1999/04/27 22:33:09 varadhan Exp $"; +static const char rcsid[] = "$Id: sys-osf.c,v 1.29 1999/08/12 04:25:24 paulus Exp $"; #endif #include @@ -375,6 +375,13 @@ establish_ppp(fd) if (i != fd && i != sockfd) close(i); closed_stdio = 1; + /* make sure 0, 1, 2 are open to /dev/null */ + while ((i = open("/dev/null", O_RDWR)) >= 0) { + if (i > 2) { + close(i); + break; + } + } } /* @@ -837,7 +844,7 @@ read_packet(buf) flags = 0; len = getmsg(pppfd, &ctrl, &data, &flags); if (len < 0) { - if (errno = EAGAIN || errno == EWOULDBLOCK || errno == EINTR) + if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) return -1; fatal("Error reading packet: %m"); }