diff options
author | John Kohl <jtkohl@mit.edu> | 1988-06-27 09:58:31 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1988-06-27 09:58:31 +0000 |
commit | 63effac6665fade31bc9feea25fad94145c59369 (patch) | |
tree | a1323150dd0fa1a6b6e0a6465ad9dc9a9b0470a7 /clients/syslogd | |
parent | a2a9df6d11a2f5ac8520ab6f2d8a963c99e6e782 (diff) |
upgrade to version from paris:/source/4.3/etc
Diffstat (limited to 'clients/syslogd')
-rw-r--r-- | clients/syslogd/syslogd.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clients/syslogd/syslogd.c b/clients/syslogd/syslogd.c index bb095b5..c6a03b4 100644 --- a/clients/syslogd/syslogd.c +++ b/clients/syslogd/syslogd.c @@ -154,6 +154,7 @@ extern char *sys_errlist[]; extern char *ctime(), *index(), *error_message(), *malloc(), *strcpyn(); extern long time(); + /* used by cfline and now zephyr ... be careful that the order is consistent with syslog.h or Zephyr messages will contain bogus info ... */ @@ -216,7 +217,7 @@ main(argc, argv) register int i; register char *p; int funix, finet, inetm, fklog, klogm, len; - struct sockaddr_un sun, fromunix; + struct sockaddr_un s_un, fromunix; struct sockaddr_in sin, frominet; FILE *fp; char line[MSG_BSIZE + 1]; @@ -278,11 +279,11 @@ main(argc, argv) (void) alarm((unsigned)(MarkInterval * 60 / MARKCOUNT)); (void) unlink(LogName); - sun.sun_family = AF_UNIX; - (void) strncpy(sun.sun_path, LogName, sizeof sun.sun_path); + s_un.sun_family = AF_UNIX; + (void) strncpy(s_un.sun_path, LogName, sizeof s_un.sun_path); funix = socket(AF_UNIX, SOCK_DGRAM, 0); - if (funix < 0 || bind(funix, (struct sockaddr *) &sun, - sizeof(sun.sun_family)+strlen(sun.sun_path)) < 0 || + if (funix < 0 || bind(funix, (struct sockaddr *) &s_un, + sizeof(s_un.sun_family)+strlen(s_un.sun_path)) < 0 || chmod(LogName, 0666) < 0) { (void) sprintf(line, "cannot create %s", LogName); logerror(line); @@ -869,6 +870,7 @@ die(sig) dprintf("syslogd: going down on signal %d\n", sig); flushmsg(); (void) sprintf(buf, "going down on signal %d", sig); + errno = 0; logerror(buf); } (void) unlink(LogName); @@ -895,6 +897,7 @@ init() /* * Close all open log files. */ + Initialized = 0; for (f = Files; f < &Files[nlogs]; f++) { if (f->f_type == F_FILE || f->f_type == F_TTY || @@ -1012,6 +1015,9 @@ cfline(line, f) char buf[MAXLINE]; dprintf("cfline(%s)\n", line); + + errno = 0; /* keep sys_errlist stuff out of logerror messages */ + /* clear out file entry */ bzero((char *) f, sizeof *f); for (i = 0; i <= LOG_NFACILITIES; i++) |