Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pchenthill
evolution-data-server
bgo-334065-tzid-crash.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bgo-334065-tzid-crash.diff of Package evolution-data-server
Index: calendar/libical/src/libical/icaltime.c =================================================================== RCS file: /cvs/gnome/libical/src/libical/icaltime.c,v retrieving revision 1.40 diff -u -p -r1.40 icaltime.c --- calendar/libical/src/libical/icaltime.c 28 Nov 2005 03:17:39 -0000 1.40 +++ calendar/libical/src/libical/icaltime.c 21 Mar 2006 16:03:56 -0000 @@ -51,6 +51,16 @@ #define strcasecmp stricmp #endif +#ifdef WIN32 +/* Undef the similar macro from pthread.h, it doesn't check if + * gmtime() returns NULL. + */ +#undef gmtime_r + +/* The gmtime() in Microsoft's C library is MT-safe */ +#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0) +#endif + #ifdef HAVE_PTHREAD #include <pthread.h> static pthread_mutex_t tzid_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -195,9 +205,13 @@ icaltime_from_timet_with_zone(const time /* Convert the time_t to a struct tm in UTC time. We can trust gmtime for this. */ - t = *(gmtime(&tm)); +#ifdef HAVE_PTHREAD + gmtime_r (&tm, &t); +#else + t = *(gmtime (&tm)); +#endif - tt.year = t.tm_year + 1900; + tt.year = t.tm_year + 1900; tt.month = t.tm_mon + 1; tt.day = t.tm_mday; tt.hour = t.tm_hour; Index: calendar/libecal/e-cal-time-util.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal-time-util.c,v retrieving revision 1.2 diff -u -p -r1.2 e-cal-time-util.c --- calendar/libecal/e-cal-time-util.c 6 May 2005 05:19:57 -0000 1.2 +++ calendar/libecal/e-cal-time-util.c 21 Mar 2006 16:03:59 -0000 @@ -570,9 +570,11 @@ char * isodate_from_time_t (time_t t) { gchar *ret; + struct tm stm; + gmtime_r (&t, &stm); ret = g_malloc (17); /* 4+2+2+1+2+2+2+1 + 1 */ - strftime (ret, 17, "%Y%m%dT%H%M%SZ", gmtime (&t)); + strftime (ret, 17, "%Y%m%dT%H%M%SZ", &stm); return ret; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor