mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-22 09:57:52 +02:00
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.
This commit is contained in:
committed by
Sebastian Wilhelmi
parent
9200f44462
commit
81f8d0bb10
@@ -416,6 +416,19 @@ g_get_any_init (void)
|
||||
g_home_dir = g_strdup (g_getenv ("HOME"));
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
/* FIXME: we must actually use the getpwuid_r function here, as
|
||||
getpwuid is not MT-safe, but the prototype doesn't seem to be
|
||||
agreed upon on the different systems, i.e. it is
|
||||
|
||||
struct passwd *getpwuid_r(uid_t uid, struct passwd * pwd,
|
||||
char *buffer, int buflen);
|
||||
|
||||
on solaris, but
|
||||
|
||||
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
|
||||
size_t bufsize struct passwd **result);
|
||||
|
||||
on posix. weird. */
|
||||
setpwent ();
|
||||
pw = getpwuid (getuid ());
|
||||
endpwent ();
|
||||
|
Reference in New Issue
Block a user