--- embedaddon/pimdd/debug.c 2017/06/12 07:58:55 1.1.1.1 +++ embedaddon/pimdd/debug.c 2017/06/14 09:28:09 1.1.1.1.2.1 @@ -34,7 +34,7 @@ * Questions concerning this software should be directed to * Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu) * - * $Id: debug.c,v 1.1.1.1 2017/06/12 07:58:55 misho Exp $ + * $Id: debug.c,v 1.1.1.1.2.1 2017/06/14 09:28:09 misho Exp $ */ /* * Part of this program has been derived from mrouted. @@ -378,6 +378,7 @@ log(int severity, int syserr, char *format, ...) static char fmt[211] = "warning - "; char *msg; struct timeval now; + time_t now_sec; struct tm *thyme; va_start(ap, format); @@ -394,6 +395,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); @@ -408,7 +410,8 @@ log(severity, syserr, format, va_alist) */ if (haveterminal && (debug || severity <= LOG_WARNING)) { gettimeofday(&now,NULL); - thyme = localtime(&now.tv_sec); + now_sec = now.tv_sec; + thyme = localtime(&now_sec); if (!debug) fprintf(stderr, "%s: ", progname); fprintf(stderr, "%02d:%02d:%02d.%03ld %s", thyme->tm_hour,