Do not use the thread libs, when searching for some functions, as this
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Mon, 25 Jan 1999 09:53:17 +0000 (09:53 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Mon, 25 Jan 1999 09:53:17 +0000 (09:53 +0000)
1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* configure.in: Do not use the thread libs, when searching for
some functions, as this might require glib to always be linked
with the thread libs on some platforms.

* gutils.c (g_get_any_init): Don't set errno to zero and use it
only as the error code, if the function returned a value less
0. It might happen, that the call succeeds, even though the errno
is set during the call (i.e. it first looks for a passwd file,
which is not found). Submitted by Michael Natterer
<mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
`getpwuid_r' change, but it had to be done once.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
glib/gutils.c
gutils.c

index 79be861..c65957c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index 79be861..c65957c 100644 (file)
@@ -1,3 +1,17 @@
+1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Do not use the thread libs, when searching for
+       some functions, as this might require glib to always be linked
+       with the thread libs on some platforms.
+
+       * gutils.c (g_get_any_init): Don't set errno to zero and use it
+       only as the error code, if the function returned a value less
+       0. It might happen, that the call succeeds, even though the errno
+       is set during the call (i.e. it first looks for a passwd file,
+       which is not found). Submitted by Michael Natterer
+       <mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
+       `getpwuid_r' change, but it had to be done once.
+
 Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>
 
        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
index a1e2178..905d619 100644 (file)
@@ -690,7 +690,9 @@ dnl ***********************************
 
 if test x"$have_threads" != xnone; then
        glib_save_LIBS="$LIBS"
-       LIBS="$LIBS $G_THREAD_LIBS"
+       # we are not doing the following for now, as this might require glib 
+       # to always be linked with the thread libs on some platforms. 
+       # LIBS="$LIBS $G_THREAD_LIBS"
        AC_CHECK_FUNCS(localtime_r rand_r)
        if test "$ac_cv_header_pwd_h" = "yes"; then
                AC_CHECK_FUNCS(getpwuid_r)
index 2dc06a4..698986b 100644 (file)
@@ -451,10 +451,9 @@ g_get_any_init (void)
             g_free (buffer);
             buffer = g_malloc (bufsize);
 
-           errno = 0;
 #    ifdef HAVE_GETPWUID_R_POSIX
             error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
-            error = error < 1 ? errno : error;
+            error = error < 0 ? errno : error;
 #    else /* !HAVE_GETPWUID_R_POSIX */
             pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
             error = pw ? 0 : errno;
index 2dc06a4..698986b 100644 (file)
--- a/gutils.c
+++ b/gutils.c
@@ -451,10 +451,9 @@ g_get_any_init (void)
             g_free (buffer);
             buffer = g_malloc (bufsize);
 
-           errno = 0;
 #    ifdef HAVE_GETPWUID_R_POSIX
             error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
-            error = error < 1 ? errno : error;
+            error = error < 0 ? errno : error;
 #    else /* !HAVE_GETPWUID_R_POSIX */
             pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
             error = pw ? 0 : errno;