diff options
Diffstat (limited to 'lib/libc/gen/syslog.c')
-rw-r--r-- | lib/libc/gen/syslog.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 11ae5b5..621e63a 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include <fcntl.h> #include <paths.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> @@ -60,6 +61,8 @@ __FBSDID("$FreeBSD$"); #endif #include "un-namespace.h" +#include "libc_private.h" + static int LogFile = -1; /* fd for log */ static int connected; /* have done connect */ static int opened; /* have done openlog() */ @@ -67,7 +70,6 @@ static int LogStat = 0; /* status bits, set by openlog() */ static const char *LogTag = NULL; /* string to tag the entry with */ static int LogFacility = LOG_USER; /* default facility code */ static int LogMask = 0xff; /* mask of priorities to be logged */ -extern char *__progname; /* Program name, from crt0. */ static void disconnectlog(void); /* disconnect from syslogd */ static void connectlog(void); /* (re)connect to syslogd */ @@ -181,7 +183,7 @@ vsyslog(pri, fmt, ap) stdp = tbuf + (sizeof(tbuf) - tbuf_cookie.left); } if (LogTag == NULL) - LogTag = __progname; + LogTag = _getprogname(); if (LogTag != NULL) (void)fprintf(fp, "%s", LogTag); if (LogStat & LOG_PID) |