]> sjero.net Git - wget/commitdiff
Replace use of localtime with localtime_r.
authorMicah Cowan <micah@cowan.name>
Fri, 4 Sep 2009 03:50:00 +0000 (20:50 -0700)
committerMicah Cowan <micah@cowan.name>
Fri, 4 Sep 2009 03:50:00 +0000 (20:50 -0700)
src/ChangeLog
src/ftp-ls.c

index 6c23ff8056820616a887ca51b00bc2013b8bee76..4cb424fb613f36b4bb22af06871a84e76e15535c 100644 (file)
@@ -1,5 +1,8 @@
 2009-09-03  Micah Cowan  <micah@cowan.name>
 
+       * 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.
index c8cb869c74cf285f4e283898fa8ba816fd667b03..cf28e6ddec9339d4e881e27488cc802a5ee42d3a 100644 (file)
@@ -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, &timestruct);
-      strptime( date_str, "%d-%b-%Y %H:%M:%S", &timestruct);
+      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 (&timestruct);
+      timenow = mktime (timestruct);
       /* Offset local time according to environment variable (seconds). */
       if ((tok = getenv( "WGET_TIMEZONE_DIFFERENTIAL")) != NULL)
         {