From 070cf9b22d71b8c3a2cd62c3a2ebcd307f2a53b3 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 27 May 1996 00:00:56 +0000 Subject: [PATCH] syslog stuff back to main.c; added strerror --- pppd/sys-sunos4.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/pppd/sys-sunos4.c b/pppd/sys-sunos4.c index 2faa216..2097c8a 100644 --- a/pppd/sys-sunos4.c +++ b/pppd/sys-sunos4.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-sunos4.c,v 1.4 1996/04/04 04:06:59 paulus Exp $"; +static char rcsid[] = "$Id: sys-sunos4.c,v 1.5 1996/05/27 00:00:56 paulus Exp $"; #endif #include @@ -103,11 +103,6 @@ sys_init() { int x; - openlog("pppd", LOG_PID | LOG_NDELAY, LOG_PPP); - setlogmask(LOG_UPTO(LOG_INFO)); - if (debug) - setlogmask(LOG_UPTO(LOG_DEBUG)); - /* Get an internet socket for doing socket ioctl's on. */ if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "Couldn't create IP socket: %m"); @@ -203,7 +198,6 @@ sys_close() close(iffd); close(pppfd); close(sockfd); - closelog(); } /* @@ -239,19 +233,6 @@ daemon(nochdir, noclose) return 0; } -/* - * note_debug_level - note a change in the debug level. - */ -void -note_debug_level() -{ - if (debug) { - setlogmask(LOG_UPTO(LOG_DEBUG)); - } else { - setlogmask(LOG_UPTO(LOG_WARNING)); - } -} - /* * ppp_available - check whether the system has any ppp interfaces */ @@ -1443,3 +1424,21 @@ strtoul(str, ptr, base) { return (unsigned long) strtol(str, ptr, base); } + +/* + * Or strerror :-( + */ +extern char *sys_errlist[]; +extern int sys_nerr; + +char * +strerror(n) + int n; +{ + static char unknown[32]; + + if (n > 0 && n < sys_nerr) + return sys_errlist[n]; + sprintf(unknown, "Error %d", n); + return unknown; +} -- 2.39.2