diff options
author | bde <bde@FreeBSD.org> | 1998-06-29 17:38:35 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-06-29 17:38:35 +0000 |
commit | be7e982a5e08a752d70421b0fe84f3bb9e04256f (patch) | |
tree | 005524c874ae1349b0c3fc4b1c0d3e1edd832b92 | |
parent | e93d50ef3bbcc0974e7290d6bee3abc58e29cfcc (diff) | |
download | FreeBSD-src-be7e982a5e08a752d70421b0fe84f3bb9e04256f.zip FreeBSD-src-be7e982a5e08a752d70421b0fe84f3bb9e04256f.tar.gz |
Don't assume that time_t is long.
-rw-r--r-- | usr.sbin/mrouted/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index 40e53d3..864d5cb 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -20,7 +20,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.12 1997/09/30 06:15:01 charnier Exp $"; + "$Id: main.c,v 1.13 1998/01/16 07:17:43 charnier Exp $"; #endif #include <err.h> @@ -677,6 +677,7 @@ log(int severity, int syserr, char *format, ...) char *msg; char tbuf[20]; struct timeval now; + time_t now_sec; struct tm *thyme; va_start(ap, format); @@ -693,6 +694,7 @@ log(severity, syserr, format, va_alist) char *msg; char tbuf[20]; struct timeval now; + time_t now_sec; struct tm *thyme; va_start(ap); @@ -707,7 +709,8 @@ log(severity, syserr, format, va_alist) case 2: if (severity > LOG_INFO ) break; default: gettimeofday(&now,NULL); - thyme = localtime(&now.tv_sec); + now_sec = now.tv_sec; + thyme = localtime(&now_sec); strftime(tbuf, sizeof(tbuf), "%X.%%03d ", thyme); fprintf(stderr, tbuf, now.tv_usec / 1000); fprintf(stderr, "%s", msg); |