OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / timegm.3
index 3ab194b..2715e5d 100644 (file)
@@ -22,7 +22,7 @@
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual"
+.TH TIMEGM 3 2013-07-04 "GNU" "Linux Programmer's Manual"
 .SH NAME
 timegm, timelocal \- inverses of gmtime and localtime
 .SH SYNOPSIS
@@ -84,12 +84,15 @@ my_timegm(struct tm *tm)
     char *tz;
 
     tz = getenv("TZ");
+    if (tz)
+        tz = strdup(tz);
     setenv("TZ", "", 1);
     tzset();
     ret = mktime(tm);
-    if (tz)
+    if (tz) {
         setenv("TZ", tz, 1);
-    else
+        free(tz);
+    } else
         unsetenv("TZ");
     tzset();
     return ret;
@@ -101,3 +104,12 @@ my_timegm(struct tm *tm)
 .BR localtime (3),
 .BR mktime (3),
 .BR tzset (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.