From: Micah Cowan Date: Fri, 4 Sep 2009 03:50:00 +0000 (-0700) Subject: Replace use of localtime with localtime_r. X-Git-Tag: v1.13~266 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=e0b8a67d3331e50388c507f9c4d0155f85af0856 Replace use of localtime with localtime_r. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6c23ff80..4cb424fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2009-09-03 Micah Cowan + * ftp-ls.c (ftp_parse_vms_ls): Replace use of localtime_r with + localtime, as not all platforms have localtime_r. + * Makefile.am (wget_SOURCES): Rearranged some of the file order, so .c files and .h files are apart. Added gettext.h, so that it shows up in the dist. diff --git a/src/ftp-ls.c b/src/ftp-ls.c index c8cb869c..cf28e6dd 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -675,7 +675,7 @@ ftp_parse_vms_ls (const char *file) int dt, i, j, len; int perms; time_t timenow; - struct tm timestruct; + struct tm *timestruct; char date_str[ 32]; char *line, *tok; /* tokenizer */ @@ -961,11 +961,11 @@ ftp_parse_vms_ls (const char *file) fails. */ timenow = time( NULL); - localtime_r( &timenow, ×truct); - strptime( date_str, "%d-%b-%Y %H:%M:%S", ×truct); + timestruct = localtime( &timenow ); + strptime( date_str, "%d-%b-%Y %H:%M:%S", timestruct); /* Convert struct tm local time to time_t local time. */ - timenow = mktime (×truct); + timenow = mktime (timestruct); /* Offset local time according to environment variable (seconds). */ if ((tok = getenv( "WGET_TIMEZONE_DIFFERENTIAL")) != NULL) {