diff options
author | ache <ache@FreeBSD.org> | 1997-05-04 02:39:04 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-05-04 02:39:04 +0000 |
commit | 027d471e2833c8d5f5406c758c4207d5ff555a8a (patch) | |
tree | 4fc262dd67c14550eb659cf10f8f3b7de6b973d4 /usr.sbin/ppp/log.c | |
parent | f1303fe1b2d0aad6464e6a1285658e5806ba0db7 (diff) | |
download | FreeBSD-src-027d471e2833c8d5f5406c758c4207d5ff555a8a.zip FreeBSD-src-027d471e2833c8d5f5406c758c4207d5ff555a8a.tar.gz |
Log each ppp line to separate /var/log/ppp.tunX.log instead mixing of
all lines into single /var/log/ppp.log
Diffstat (limited to 'usr.sbin/ppp/log.c')
-rw-r--r-- | usr.sbin/ppp/log.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index 2f57814..2a45c20 100644 --- a/usr.sbin/ppp/log.c +++ b/usr.sbin/ppp/log.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: log.c,v 1.7 1997/02/22 16:10:26 peter Exp $ + * $Id: log.c,v 1.8 1997/03/13 14:53:53 brian Exp $ * */ #include "defs.h" @@ -42,7 +42,7 @@ static FILE *logfile; #endif static char logbuff[2000]; -static char *logptr; +char *logptr; static struct mbuf *logtop; static struct mbuf *lognext; static int logcnt; @@ -62,12 +62,16 @@ ListLog() } int -LogOpen() +LogOpen(tunno) +int tunno; { #ifdef USELOGFILE - logfile = fopen(LOGFILE, "a"); + char buf[80]; + + sprintf(buf, LOGFILE, tunno); + logfile = fopen(buf, "a"); if (logfile == NULL) { - fprintf(stderr, "can't open %s.\r\n", LOGFILE); + fprintf(stderr, "can't open %s.\r\n", buf); return(1); } #endif @@ -122,6 +126,7 @@ LogClose() #ifdef USELOGFILE fclose(logfile); #endif + logptr = NULL; } #ifdef NO_VSPRINTF @@ -285,12 +290,14 @@ void LogReOpen( sig ) int sig; { +#ifdef USELOGFILE FILE *nlogfile; + char buf[80]; -#ifdef USELOGFILE - nlogfile = fopen(LOGFILE, "a"); + sprintf(buf, LOGFILE, tunno); + nlogfile = fopen(buf, "a"); if (nlogfile == NULL) { - LogPrintf(~0,"can't re-open %s.\r\n", LOGFILE); + LogPrintf(~0,"can't re-open %s.\r\n", buf); } else { LogPrintf(~0,"log file closed due to signal %d.\r\n",sig); |