mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
Check for the sched.h header and include it on gthread/gthread-posix.c if
2000-11-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * configure.in: Check for the sched.h header and include it on gthread/gthread-posix.c if available. * gthread-posix.c: Include <sched.h> if available. * configure.in: Add -D_POSIX4_DRAFT_SOURCE to GTHREAD_COMPILE_IMPL_DEFINES. Also add -D_POSIX4A_DRAFT10_SOURCE to G_THREAD_CFLAGS. Really deploy GTHREAD_COMPILE_IMPL_DEFINES, when searching for thread libs. Look for sched_* functions in -lrte as well. All of that is necessary on DG/UX. * configure.in: Use AC_TRY_COMPILE instead of AC_EGREP_HEADERS in various places to make it work more reliable, to make it accept macros instead of functions etc. * configure.in: Replace some NULL's for checks with 0 to make it work without stdio.h everywhere. * configure.in, gutils.c: changed the test for getpwuid_r to first test for a posix version and then for a non-posix version. No code change in gutils.c. Again this change deals better with getpwuid_r being a macro and not a function. Most of the above with kind help from Tethys <tet@isengard.europe.dg.com>. This fixes Bug #13403.
This commit is contained in:
committed by
Sebastian Wilhelmi
parent
760845b183
commit
b9731eb861
10
gutils.c
10
gutils.c
@@ -715,7 +715,7 @@ g_get_any_init (void)
|
||||
struct passwd *pw = NULL;
|
||||
gpointer buffer = NULL;
|
||||
|
||||
# ifdef HAVE_GETPWUID_R
|
||||
# if defined (HAVE_POSIX_GETPWUID_R) || defined (HAVE_NONPOSIX_GETPWUID_R)
|
||||
struct passwd pwd;
|
||||
# ifdef _SC_GETPW_R_SIZE_MAX
|
||||
/* This reurns the maximum length */
|
||||
@@ -731,10 +731,10 @@ g_get_any_init (void)
|
||||
buffer = g_malloc (bufsize);
|
||||
errno = 0;
|
||||
|
||||
# ifdef HAVE_GETPWUID_R_POSIX
|
||||
# ifdef HAVE_POSIX_GETPWUID_R
|
||||
error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
|
||||
error = error < 0 ? errno : error;
|
||||
# else /* !HAVE_GETPWUID_R_POSIX */
|
||||
# else /* HAVE_NONPOSIX_GETPWUID_R */
|
||||
# ifdef _AIX
|
||||
error = getpwuid_r (getuid (), &pwd, buffer, bufsize);
|
||||
pw = error == 0 ? &pwd : NULL;
|
||||
@@ -742,7 +742,7 @@ g_get_any_init (void)
|
||||
pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
|
||||
error = pw ? 0 : errno;
|
||||
# endif /* !_AIX */
|
||||
# endif /* !HAVE_GETPWUID_R_POSIX */
|
||||
# endif /* HAVE_NONPOSIX_GETPWUID_R */
|
||||
|
||||
if (!pw)
|
||||
{
|
||||
@@ -768,7 +768,7 @@ g_get_any_init (void)
|
||||
}
|
||||
}
|
||||
while (!pw);
|
||||
# endif /* !HAVE_GETPWUID_R */
|
||||
# endif /* HAVE_POSIX_GETPWUID_R || HAVE_NONPOSIX_GETPWUID_R */
|
||||
|
||||
if (!pw)
|
||||
{
|
||||
|
Reference in New Issue
Block a user