Correct thread-unsafe use of gmtime().
authorZdeněk Salvet <salvet@ics.muni.cz>
Tue, 24 Jan 2006 09:52:56 +0000 (09:52 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Tue, 24 Jan 2006 09:52:56 +0000 (09:52 +0000)
org.glite.lb.common/src/ulm_parse.c

index 2525a3e..855c26b 100644 (file)
@@ -384,13 +384,14 @@ void edg_wll_ULMSplitDate( const char *s,
 int edg_wll_ULMTimevalToDate( long sec, long usec, char *dstr )
 {
   char *func = "edg_wll_ULMTimevalToDate";
+  struct tm tms;
   struct tm *tp;
   int        len;
 
   if ( sec < 0 || usec < 0 || usec > 999999 )
     return 1;
 
-  tp = gmtime( (const time_t *) &sec );
+  tp = gmtime_r( (const time_t *) &sec, &tms );
   if ( tp == NULL )
     return 1;