]> git.ozlabs.org Git - ppp.git/commitdiff
make sure fds 0, 1, 2 are always open
authorPaul Mackerras <paulus@samba.org>
Wed, 12 May 1999 06:16:16 +0000 (06:16 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 12 May 1999 06:16:16 +0000 (06:16 +0000)
pppd/sys-osf.c

index 9ee243473694cd6affc9df8e69dfde6bcbf6af80..6d882a95c3af914e9bf105ced7c78d7df019de7a 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-osf.c,v 1.26 1999/04/27 22:33:09 varadhan Exp $";
+static char rcsid[] = "$Id: sys-osf.c,v 1.27 1999/05/12 06:16:16 paulus Exp $";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -375,6 +375,13 @@ establish_ppp(fd)
             if (i != fd && i != sockfd)
                 close(i);
         closed_stdio = 1;
             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;
+           }
+       }
     }
 
     /*
     }
 
     /*