diff --git a/src/audit/audit.c b/src/audit/audit.c index de73c6f372..2c45aeb586 100644 --- a/src/audit/audit.c +++ b/src/audit/audit.c @@ -176,7 +176,7 @@ printbuf(int rec, char *audEvent, char *afsName, afs_int32 hostId, /* Don't print the timestamp or thread id if we recursed */ if (rec == 0) { currenttime = time(0); - if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y ", + if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y ", localtime_r(¤ttime, &tm)) !=0) audit_ops->append_msg(tbuffer); diff --git a/src/butc/lwps.c b/src/butc/lwps.c index f479b78ab6..0383ec850c 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -198,7 +198,7 @@ TapeLogStr(int debug, afs_int32 task, afs_int32 error1, afs_int32 error2, struct tm tm; now = time(0); - if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)) != 0) fprintf(logIO, "%s: ", tbuffer); @@ -255,7 +255,7 @@ ErrorLogStr(int debug, afs_int32 task, afs_int32 error1, afs_int32 error2, struct tm tm; now = time(0); - if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + if (strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)) != 0) fprintf(ErrorlogIO, "%s: ", tbuffer); diff --git a/src/util/assert.c b/src/util/assert.c index 78e9d0ce57..197e1fdbf0 100644 --- a/src/util/assert.c +++ b/src/util/assert.c @@ -33,7 +33,7 @@ AssertionFailed(char *file, int line) struct tm tm; when = time(NULL); - strftime(tdate, sizeof(tdate), "%a %b %d %T %Y", + strftime(tdate, sizeof(tdate), "%a %b %d %H:%M:%S %Y", localtime_r(&when, &tm)); fprintf(stderr, "%s Assertion failed! file %s, line %d.\n", tdate, file, line); diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 77f069eb17..7c5eae167a 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -107,7 +107,7 @@ vFSLog(const char *format, va_list args) int num; currenttime = time(NULL); - len = strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y ", + len = strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y ", localtime_r(¤ttime, &tm)); info = &tbuffer[len]; diff --git a/src/viced/host.c b/src/viced/host.c index 0630067444..ac9ec9c1b8 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2757,7 +2757,7 @@ h_PrintClient(struct host *host, void *rock) H_UNLOCK; return 0; } - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&LastCall, &tm)); snprintf(tmpStr, sizeof tmpStr, "Host %s:%d down = %d, LastCall %s\n", afs_inet_ntoa_r(host->host, hoststr), @@ -2767,7 +2767,7 @@ h_PrintClient(struct host *host, void *rock) for (client = host->FirstClient; client; client = client->next) { if (!client->deleted) { expTime = client->expTime; - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&expTime, &tm)); snprintf(tmpStr, sizeof tmpStr, " user id=%d, name=%s, sl=%s till %s\n", @@ -2818,7 +2818,7 @@ h_PrintClients(void) return; } now = FT_ApproxTime(); - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)); snprintf(tmpStr, sizeof tmpStr, "List of active users at %s\n\n", tbuffer); @@ -2892,7 +2892,7 @@ h_DumpHosts(void) return; } now = FT_ApproxTime(); - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)); snprintf(tmpStr, sizeof tmpStr, "List of active hosts at %s\n\n", tbuffer); (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); diff --git a/src/viced/viced.c b/src/viced/viced.c index b36c2ea843..ce77ccedc6 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -464,7 +464,7 @@ FiveMinuteCheckLWP(void *unused) if (printBanner && (++msg & 1)) { /* Every 10 minutes */ time_t now = FT_ApproxTime(); struct tm tm; - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)); ViceLog(2, ("File server is running at %s\n", tbuffer)); @@ -687,7 +687,7 @@ PrintCounters(void) FT_GetTimeOfDay(&tpl, 0); Statistics = 1; - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&StartTime, &tm)); ViceLog(0, ("Vice was last started at %s\n", tbuffer)); @@ -802,7 +802,7 @@ ShutDownAndCore(int dopanic) FS_STATE_UNLOCK; #endif - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)); ViceLog(0, ("Shutting down file server at %s\n", tbuffer)); if (dopanic) @@ -852,7 +852,7 @@ ShutDownAndCore(int dopanic) fflush(debugFile); } now = time(0); - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&now, &tm)); if (dopanic) { ViceLog(0, ("File server has terminated abnormally at %s\n", tbuffer)); @@ -2311,7 +2311,7 @@ main(int argc, char *argv[]) } t = tp.tv_sec; - strftime(tbuffer, sizeof(tbuffer), "%a %b %d %T %Y", + strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&t, &tm)); ViceLog(0, ("File Server started %s\n", tbuffer)); #if FS_STATS_DETAILED diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index 4860c00602..1ba73387f8 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -1276,7 +1276,7 @@ dump_stats(vldstats *stats, vital_vlheader *vital_header) time_t start_time = stats->start_time; struct tm tm; - strftime(strg, sizeof(strg), "%a %b %d %T %Y", + strftime(strg, sizeof(strg), "%a %b %d %H:%M:%S %Y", localtime_r(&start_time, &tm)); printf("Dynamic statistics stats (starting time: %s):\n", strg); printf("OpcodeName\t# Requests\t# Aborts\n");