mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 23:40:13 +00:00
Windows: Replace "%T" as format string to strftime
Checkin I18ed36cc4dce9aa354ad1398710ab7db83c814a2 made strftime much more widespread. However the %T format is not available on all platforms and causes (at least) Windows servers to fail on first attempt to log. %T is just shorthand to %H:%M:%S so this checkin just replaces the one with the other. Change-Id: Ibfff133d9263f5513276d96f3624801fd8ab229e Reviewed-on: http://gerrit.openafs.org/5364 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
37d72aa156
commit
8a24a7c933
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user