Loading tests/server/util.c +6 −7 Original line number Diff line number Diff line Loading @@ -81,21 +81,20 @@ void logmsg(const char *msg, ...) struct tm *now = localtime(&tv.tv_sec); /* not multithread safe but we don't care */ char timebuf[12]; snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%02ld", now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec/10000); char timebuf[20]; snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld", now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec); va_start(ap, msg); vsprintf(buffer, msg, ap); va_end(ap); logfp = fopen(serverlogfile, "a"); fprintf(logfp?logfp:stderr, /* write to stderr if the logfile doesn't open */ "%s %s\n", timebuf, buffer); if(logfp) if(logfp) { fprintf(logfp, "%s %s\n", timebuf, buffer); fclose(logfp); } } #if defined(WIN32) && !defined(__CYGWIN__) /* use instead of perror() on generic windows */ Loading Loading
tests/server/util.c +6 −7 Original line number Diff line number Diff line Loading @@ -81,21 +81,20 @@ void logmsg(const char *msg, ...) struct tm *now = localtime(&tv.tv_sec); /* not multithread safe but we don't care */ char timebuf[12]; snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%02ld", now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec/10000); char timebuf[20]; snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld", now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec); va_start(ap, msg); vsprintf(buffer, msg, ap); va_end(ap); logfp = fopen(serverlogfile, "a"); fprintf(logfp?logfp:stderr, /* write to stderr if the logfile doesn't open */ "%s %s\n", timebuf, buffer); if(logfp) if(logfp) { fprintf(logfp, "%s %s\n", timebuf, buffer); fclose(logfp); } } #if defined(WIN32) && !defined(__CYGWIN__) /* use instead of perror() on generic windows */ Loading