From: Zdeněk Salvet Date: Tue, 24 Jan 2006 09:52:56 +0000 (+0000) Subject: Correct thread-unsafe use of gmtime(). X-Git-Tag: glite-lb-common_R_3_0_3~10 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7578172516a84e62aed8243b294a424a563b0a71;p=jra1mw.git Correct thread-unsafe use of gmtime(). --- diff --git a/org.glite.lb.common/src/ulm_parse.c b/org.glite.lb.common/src/ulm_parse.c index 2525a3e..855c26b 100644 --- a/org.glite.lb.common/src/ulm_parse.c +++ b/org.glite.lb.common/src/ulm_parse.c @@ -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;