[PATCH] Fix uninitialized var in gai_suspend

Jakub Jelinek jakub@redhat.com
Wed Sep 6 16:37:00 GMT 2006


Hi!

GAI_MISC_WAIT macro only sets result on error, so without this patch
we return an uninitialized value.

2006-09-06  Jakub Jelinek  <jakub@redhat.com>

	* resolv/gai_suspend.c (gai_suspend): Make sure result is initialized.

--- libc/resolv/gai_suspend.c.jj	2006-08-03 10:03:46.000000000 +0200
+++ libc/resolv/gai_suspend.c	2006-09-06 17:30:22.000000000 +0200
@@ -83,6 +83,7 @@ gai_suspend (const struct gaicb *const l
       pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
 
 #ifdef DONT_NEED_GAI_MISC_COND
+      result = 0;
       GAI_MISC_WAIT (result, cntr, timeout, 1);
 #else
       if (timeout == NULL)

	Jakub



More information about the Libc-hacker mailing list