X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=86315662b0611ba6b7d62434ee8b380e9c10396b;hb=81131c3cca1cb450d8ff67213182d9d06dc5d9ad;hp=640782ad6f35d03b02f08d583733669734943acd;hpb=71d3de90eae52087b405e962ca650b71cec79c67;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index 640782a..8631566 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.128 2003/06/11 23:56:26 paulus Exp $" +#define RCSID "$Id: main.c,v 1.130 2003/12/17 08:56:05 kad Exp $" #include #include @@ -1337,8 +1337,8 @@ kill_my_pg(sig) act.sa_handler = SIG_IGN; act.sa_flags = 0; - kill(0, sig); sigaction(sig, &act, &oldact); + kill(0, sig); sigaction(sig, &oldact, NULL); } @@ -1503,6 +1503,7 @@ device_script(program, in, out, dont_wait) int pid; int status = -1; int errfd; + int fd; ++conn_running; pid = safe_fork(); @@ -1530,6 +1531,14 @@ device_script(program, in, out, dont_wait) /* here we are executing in the child */ + /* make sure fds 0, 1, 2 are occupied */ + while ((fd = dup(in)) >= 0) { + if (fd > 2) { + close(fd); + break; + } + } + /* dup in and out to fds > 2 */ { int fd1 = in, fd2 = out, fd3 = log_to_fd;