X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=7924b5df7dbb583ba4a1385f8ca4f9d436333bc9;hp=9c4cb46a8dc7e5bc45d44305ef6de54d12789fa7;hb=cd8692c099106d7acad6fd0215a899dae866792a;hpb=4f7e19816b21500f2e499df26551fbdd158c76a0 diff --git a/pppd/main.c b/pppd/main.c index 9c4cb46..7924b5d 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -66,7 +66,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: main.c,v 1.153 2006/06/04 03:52:50 paulus Exp $" +#define RCSID "$Id: main.c,v 1.154 2006/12/19 07:48:19 paulus Exp $" #include #include @@ -1567,6 +1567,8 @@ safe_fork(int infd, int outfd, int errfd) if (errfd == 0 || errfd == 1) errfd = dup(errfd); + closelog(); + /* dup the in, out, err fds to 0, 1, 2 */ if (infd != 0) dup2(infd, 0); @@ -1575,7 +1577,6 @@ safe_fork(int infd, int outfd, int errfd) if (errfd != 2) dup2(errfd, 2); - closelog(); if (log_to_fd > 2) close(log_to_fd); if (the_channel->close)