Do not use the thread libs, when searching for some functions, as this

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.
This commit is contained in:
Sebastian Wilhelmi
1999-01-25 09:53:17 +00:00
committed by Sebastian Wilhelmi
parent c5fd4a3dc4
commit def1947e4f
11 changed files with 117 additions and 5 deletions

View 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;