[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r2630 - in glibc-package/branches/glibc-2.7/debian/patches: . hurd-i386



Author: aurel32
Date: 2007-10-28 19:40:34 +0000 (Sun, 28 Oct 2007)
New Revision: 2630

Modified:
   glibc-package/branches/glibc-2.7/debian/patches/hurd-i386/submitted-libc_once.diff
   glibc-package/branches/glibc-2.7/debian/patches/series
Log:
Fix hurd-i386/submitted-libc_once.diff


Modified: glibc-package/branches/glibc-2.7/debian/patches/hurd-i386/submitted-libc_once.diff
===================================================================
--- glibc-package/branches/glibc-2.7/debian/patches/hurd-i386/submitted-libc_once.diff	2007-10-28 19:16:46 UTC (rev 2629)
+++ glibc-package/branches/glibc-2.7/debian/patches/hurd-i386/submitted-libc_once.diff	2007-10-28 19:40:34 UTC (rev 2630)
@@ -1,174 +1,70 @@
-http://savannah.gnu.org/bugs/?18217
-http://sourceware.org/bugzilla/show_bug.cgi?id=3748
+2007-10-28  Aurelien Jarno  <aurelien@aurel32.net>
 
-
-2007-02-08  Aurelien Jarno  <aurelien@aurel32.net>
-
-	* linuxthreads/sysdeps/pthread/bits/libc-lock.h (__libc_once_else): New
-	definition.
-
-2006-12-18  Thomas Schwinge  <tschwinge@gnu.org>
-
-	* bits/libc-lock.h (__libc_once_else): New definiton.
+	* bits/libc-lock.h (__libc_once_get): New definiton.
+	* linuxthreads/sysdeps/pthread/bits/libc-lock.h: Likewise
+	* nptl/sysdeps/pthread/bits/libc-lock.h: Likewise.
 	* sysdeps/mach/bits/libc-lock.h: Likewise.
 	* sysdeps/mach/hurd/bits/libc-lock.h: Likewise.
-	* nptl/sysdeps/pthread/bits/libc-lock.h: Likewise.
-	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Use __libc_once_else and a
-	new local function instead of using implementational details.
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Use __libc_once_get
+	  instead of using implementational details.
 
---- sysdeps/posix/getaddrinfo.c.orig
-+++ sysdeps/posix/getaddrinfo.c
-@@ -1950,9 +1950,13 @@
-   if (naddrs > 1)
-     {
-       /* Read the config file.  */
-+      void _gaiconf_reload (void) 
-+      {
-+        if (gaiconf_reload_flag)
-+          gaiconf_reload ();
-+      }
-       __libc_once_define (static, once);
--      __typeof (once) old_once = once;
--      __libc_once (once, gaiconf_init);
-+      __libc_once_else (once, gaiconf_init, _gaiconf_reload);
-       /* Sort results according to RFC 3484.  */
-       struct sort_result results[nresults];
-       struct addrinfo *q;
 --- bits/libc-lock.h.orig
 +++ bits/libc-lock.h
-@@ -89,7 +89,7 @@
- /* Define once control variable.  */
- #define __libc_once_define(CLASS, NAME) CLASS int NAME = 0
- 
--/* Call handler iff the first call.  */
-+/* Call INIT_FUNCTION iff the first call.  */
- #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
-   do {									      \
-     if ((ONCE_CONTROL) == 0) {						      \
-@@ -98,6 +98,15 @@
+@@ -98,6 +98,9 @@
      }									      \
    } while (0)
  
-+/* Call INIT_FUNCTION iff the first call.  Otherwise call ELSE_FUNCTION.  */
-+#define __libc_once_else(ONCE_CONTROL, INIT_FUNCTION, ELSE_FUNCTION) \
-+  do {									      \
-+    if ((ONCE_CONTROL) == 1)						      \
-+      (ELSE_FUNCTION) ();						      \
-+    else								      \
-+      __libc_once (ONCE_CONTROL, INIT_FUNCTION);			      \
-+  } while (0)
-+
++/* Get once control variable.  */
++#define __libc_once_get(ONCE_CONTROL) \
++  ((ONCE_CONTROL) == 1)
  
  /* Start a critical region with a cleanup function */
  #define __libc_cleanup_region_start(DOIT, FCT, ARG)			    \
---- sysdeps/mach/bits/libc-lock.h.orig
-+++ sysdeps/mach/bits/libc-lock.h
-@@ -105,8 +105,7 @@
- #define __libc_once_define(CLASS,NAME) \
-   CLASS struct __libc_once NAME = { MUTEX_INITIALIZER, 0 }
- 
--
--/* Call handler iff the first call.  */
-+/* Call INIT_FUNCTION iff the first call.  */
- #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
-   do {									      \
-     __libc_lock_lock (ONCE_CONTROL.lock);				      \
-@@ -116,6 +115,16 @@
-     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
+--- linuxthreads/sysdeps/pthread/bits/libc-lock.h.orig
++++ linuxthreads/sysdeps/pthread/bits/libc-lock.h
+@@ -242,6 +242,9 @@
+     }									      \
    } while (0)
  
-+/* Call INIT_FUNCTION iff the first call.  Otherwise call ELSE_FUNCTION.  */
-+#define __libc_once_else(ONCE_CONTROL, INIT_FUNCTION, ELSE_FUNCTION) \
-+  do {									      \
-+    if (ONCE_CONTROL.done == 1)						      \
-+      (ELSE_FUNCTION) ();						      \
-+    else								      \
-+      __libc_once (ONCE_CONTROL, INIT_FUNCTION);			      \
-+  } while (0)
-+
-+
- #ifdef _LIBC
- /* We need portable names for some functions.  E.g., when they are
-    used as argument to __libc_cleanup_region_start.  */
---- sysdeps/mach/hurd/bits/libc-lock.h.orig
-+++ sysdeps/mach/hurd/bits/libc-lock.h
-@@ -175,7 +175,7 @@
- #define __libc_once_define(CLASS,NAME) \
-   CLASS struct __libc_once NAME = { MUTEX_INITIALIZER, 0 }
++/* Get once control variable.  */
++#define __libc_once_get(ONCE_CONTROL) \
++  ((ONCE_CONTROL) != PTHREAD_ONCE_INIT)
  
--/* Call handler iff the first call.  */
-+/* Call INIT_FUNCTION iff the first call.  */
- #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
-   do {									      \
-     __libc_lock_lock (ONCE_CONTROL.lock);				      \
-@@ -185,6 +185,16 @@
-     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
-   } while (0)
- 
-+/* Call INIT_FUNCTION iff the first call.  Otherwise call ELSE_FUNCTION.  */
-+#define __libc_once_else(ONCE_CONTROL, INIT_FUNCTION, ELSE_FUNCTION) \
-+  do {									      \
-+    if (ONCE_CONTROL.done == 1)						      \
-+      ELSE_FUNCTION ();							      \
-+    else								      \
-+      __libc_once (ONCE_CONTROL, INIT_FUNCTION);			      \
-+  } while (0)
-+
-+
- #ifdef _LIBC
- /* We need portable names for some functions.  E.g., when they are
-    used as argument to __libc_cleanup_region_start.  */
+ /* Start critical region with cleanup.  */
+ #define __libc_cleanup_region_start(DOIT, FCT, ARG) \
 --- nptl/sysdeps/pthread/bits/libc-lock.h.orig
 +++ nptl/sysdeps/pthread/bits/libc-lock.h
-@@ -354,7 +354,7 @@
-   CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT
- #endif
- 
--/* Call handler iff the first call.  */
-+/* Call INIT_FUNCTION iff the first call.  */
- #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
-   do {									      \
-     if (PTFAVAIL (__pthread_once))					      \
-@@ -366,6 +366,15 @@
+@@ -377,6 +377,9 @@
      }									      \
    } while (0)
  
-+/* Call INIT_FUNCTION iff the first call.  Otherwise call ELSE_FUNCTION.  */
-+#define __libc_once_else(ONCE_CONTROL, INIT_FUNCTION, ELSE_FUNCTION) \
-+  do {									      \
-+    if ((ONCE_CONTROL) != PTHREAD_ONCE_INIT)				      \
-+      (ELSE_FUNCTION) ();						      \
-+    else								      \
-+      __libc_once (ONCE_CONTROL, INIT_FUNCTION);			      \
-+  } while (0)
-+
++/* Get once control variable.  */
++#define __libc_once_get(ONCE_CONTROL) \
++  ((ONCE_CONTROL) != PTHREAD_ONCE_INIT)
  
  /* Note that for I/O cleanup handling we are using the old-style
     cancel handling.  It does not have to be integrated with C++ snce
---- linuxthreads/sysdeps/pthread/bits/libc-lock.h.orig
-+++ linuxthreads/sysdeps/pthread/bits/libc-lock.h
-@@ -231,7 +231,7 @@
-   CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT
- #endif
- 
--/* Call handler iff the first call.  */
-+/* Call INIT_FUNCTION iff the first call.  */
- #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
-   do {									      \
-     if (__pthread_once != NULL)						      \
-@@ -242,6 +242,15 @@
-     }									      \
+--- sysdeps/mach/hurd/bits/libc-lock.h.orig
++++ sysdeps/mach/hurd/bits/libc-lock.h
+@@ -185,6 +185,10 @@
+     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
    } while (0)
  
-+/* Call INIT_FUNCTION iff the first call.  Otherwise call ELSE_FUNCTION.  */
-+#define __libc_once_else(ONCE_CONTROL, INIT_FUNCTION, ELSE_FUNCTION) \
-+  do {									      \
-+    if ((ONCE_CONTROL) != PTHREAD_ONCE_INIT)				      \
-+      (ELSE_FUNCTION) ();						      \
-+    else								      \
-+      __libc_once (ONCE_CONTROL, INIT_FUNCTION);			      \
-+  } while (0)
++/* Get once control variable.  */
++#define __libc_once_get(ONCE_CONTROL) \
++  (!ONCE_CONTROL.done)
 +
+ #ifdef _LIBC
+ /* We need portable names for some functions.  E.g., when they are
+    used as argument to __libc_cleanup_region_start.  */
+--- sysdeps/posix/getaddrinfo.c.orig
++++ sysdeps/posix/getaddrinfo.c
+@@ -2076,7 +2076,7 @@
+ 	  __libc_lock_define_initialized (static, lock);
  
- /* Start critical region with cleanup.  */
- #define __libc_cleanup_region_start(DOIT, FCT, ARG) \
+ 	  __libc_lock_lock (lock);
+-	  if (old_once && gaiconf_reload_flag)
++	  if (__libc_once_get(old_once) && gaiconf_reload_flag)
+ 	    gaiconf_reload ();
+ 	  qsort (results, nresults, sizeof (results[0]), rfc3484_sort);
+ 	  __libc_lock_unlock (lock);

Modified: glibc-package/branches/glibc-2.7/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.7/debian/patches/series	2007-10-28 19:16:46 UTC (rev 2629)
+++ glibc-package/branches/glibc-2.7/debian/patches/series	2007-10-28 19:40:34 UTC (rev 2630)
@@ -73,7 +73,7 @@
 hurd-i386/local-mlock.diff 
 hurd-i386/local-msg-nosignal.diff -p0
 hurd-i386/local-tls.diff 
-# hurd-i386/local-tls-support.diff -p0
+hurd-i386/local-tls-support.diff -p0
 hurd-i386/submitted-ioctl-decode-argument.diff -p0
 hurd-i386/submitted-libc_once.diff -p0
 hurd-i386/submitted-stat.diff -p0



Reply to: