diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 1999-01-07 16:17:42 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 1999-01-07 16:17:42 +0000 |
commit | 81f8d0bb10c945c459b2a8063bf70039be113771 (patch) | |
tree | ca4b4ce4df360d0a728e542beeb92aa455e3f712 /gdate.c | |
parent | 9200f444626fd7b814c30f351f872a11e0d9a64c (diff) | |
download | glib-81f8d0bb10c945c459b2a8063bf70039be113771.tar.gz |
Here we must replace getpwuid by getpwuid_r, but as I do not know how for
1999-01-07 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_any_init): Here we must replace getpwuid by
getpwuid_r, but as I do not know how for now, I just made a FIXME
note ;-)
* gdate.c (g_date_set_time): localtime --> localtime_r to make it
thread safe.
* configure.in: We do not need to check for broken solaris mutex
intitializer any longer. Provide a macro to show the used thread
implementation. Not nice, but this is needed until thread support
is completed here inside glib.
* gthread/testgthread.c: conditionally compile according to the
G_THREADS_IMPL_??? macros.
(test_private_func): use rand_r instead of rand to make it
thread safe.
Diffstat (limited to 'gdate.c')
-rw-r--r-- | gdate.c | 29 |
1 files changed, 11 insertions, 18 deletions
@@ -790,28 +790,21 @@ g_date_set_time (GDate *d, GTime time) { time_t t = time; - struct tm *tm; + struct tm tm; g_return_if_fail (d != NULL); - tm = localtime (&t); + localtime_r (&t, &tm); - if (tm) - { - d->julian = FALSE; - - d->month = tm->tm_mon + 1; - d->day = tm->tm_mday; - d->year = tm->tm_year + 1900; - - g_return_if_fail (g_date_valid_dmy (d->day, d->month, d->year)); - - d->dmy = TRUE; - } - else - { - g_date_clear (d, 1); - } + d->julian = FALSE; + + d->month = tm.tm_mon + 1; + d->day = tm.tm_mday; + d->year = tm.tm_year + 1900; + + g_return_if_fail (g_date_valid_dmy (d->day, d->month, d->year)); + + d->dmy = TRUE; } void |