X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=5f30dd1867cbfd530a5786cfa4970b85e76e7247;hp=2c261e7c374c1dd6c36bb93c8f3259d02888e8a1;hb=96d6d93dc44fc9c76cdaf7ada6deaf515f18680e;hpb=31b9087e92f1d0ecf87dc05c2ff4704be7b19870 diff --git a/pppd/main.c b/pppd/main.c index 2c261e7..5f30dd1 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.121 2003/02/24 11:26:57 fcusack Exp $" +#define RCSID "$Id: main.c,v 1.122 2003/02/24 12:46:37 fcusack Exp $" #include #include @@ -1455,16 +1455,19 @@ device_script(program, in, out, dont_wait) } /* dup in and out to fds > 2 */ - fd = in; - in = dup(in); - close(fd); - fd = out; - out = dup(out); - close(fd); - if (log_to_fd >= 0) { - errfd = dup(log_to_fd); - } else { - errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600); + { + int fd1 = in, fd2 = out, fd3 = log_to_fd; + + in = dup(in); + out = dup(out); + if (log_to_fd >= 0) { + errfd = dup(log_to_fd); + } else { + errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600); + } + close(fd1); + close(fd2); + close(fd3); } /* close fds 0 - 2 and any others we can think of */