lib/, src/: Use local time for human-readable dates
That is, use localtime_r(3) instead of gmtime_r(3). Closes: <https://github.com/shadow-maint/shadow/issues/1057> Reported-by: Gus Kenion <https://github.com/kenion> Cc: Serge Hallyn <serge@hallyn.com> Cc: Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
f3f501c81c
commit
3f5b4b5626
@@ -38,7 +38,7 @@ day_to_str(size_t size, char buf[size], long day)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gmtime_r(&date, &tm) == NULL) {
|
||||
if (localtime_r(&date, &tm) == NULL) {
|
||||
strtcpy(buf, "future", size);
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ print_day_as_date(long day)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gmtime_r(&date, &tm) == NULL) {
|
||||
if (localtime_r(&date, &tm) == NULL) {
|
||||
(void) printf ("time_t: %lu\n", (unsigned long)date);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user