resolv: Call gmtime_r instead of gmtime in p_secstodate [BZ #20017]

This commit is contained in:
Florian Weimer 2016-05-10 10:50:24 +02:00
parent 8db2cf163e
commit 4efdc6d956
2 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2016-05-10 Florian Weimer <fweimer@redhat.com>
[BZ #20017]
* resolv/res_debug.c (p_secstodate): Call __gmtime_r instead of
gmtime.
2016-05-10 Florian Weimer <fweimer@redhat.com>
[BZ #19994]

View File

@ -1035,13 +1035,8 @@ p_secstodate (u_long secs) {
time_t clock = secs;
struct tm *time;
#ifdef HAVE_TIME_R
struct tm timebuf;
time = gmtime_r(&clock, &timebuf);
#else
time = gmtime(&clock);
#endif
time = __gmtime_r(&clock, &timebuf);
time->tm_year += 1900;
time->tm_mon += 1;
sprintf(output, "%04d%02d%02d%02d%02d%02d",