about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2012-05-10 14:50:14 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-10 15:57:24 -0700
commitbe971a2b1c7828d94c41edd5cd22c1d9dcef1b6e (patch)
tree6b30a52fdbc036f34167cb1cbf1236a0e792d022 /sysdeps
parent37233df9d1fa7a1a6ff3a72ce4f642b1a96de9ca (diff)
downloadglibc-be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e.tar.gz
glibc-be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e.tar.xz
glibc-be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e.zip
Hurd: libc_once_get
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/bits/libc-lock.h5
-rw-r--r--sysdeps/mach/hurd/bits/libc-lock.h5
-rw-r--r--sysdeps/posix/getaddrinfo.c2
3 files changed, 9 insertions, 3 deletions
diff --git a/sysdeps/mach/bits/libc-lock.h b/sysdeps/mach/bits/libc-lock.h
index 0a627e75ff..110e25e965 100644
--- a/sysdeps/mach/bits/libc-lock.h
+++ b/sysdeps/mach/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Mach cthreads version.
-   Copyright (C) 1996,97,98,2000,01, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -115,6 +115,9 @@ struct __libc_once
     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL).done != 0)
+
 #ifdef _LIBC
 /* We need portable names for some functions.  E.g., when they are
    used as argument to __libc_cleanup_region_start.  */
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h
index af531da54f..d18a10c457 100644
--- a/sysdeps/mach/hurd/bits/libc-lock.h
+++ b/sysdeps/mach/hurd/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Hurd version using Mach cthreads.
-   Copyright (C) 1996,97,98,2000,01, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -187,6 +187,9 @@ struct __libc_once
     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL).done != 0)
+
 #ifdef _LIBC
 /* We need portable names for some functions.  E.g., when they are
    used as argument to __libc_cleanup_region_start.  */
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 1a023f91f5..2eca2ae0e4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2604,7 +2604,7 @@ getaddrinfo (const char *name, const char *service,
 	  __libc_lock_define_initialized (static, lock);
 
 	  __libc_lock_lock (lock);
-	  if (old_once && gaiconf_reload_flag)
+	  if (__libc_once_get (old_once) && gaiconf_reload_flag)
 	    gaiconf_reload ();
 	  qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
 	  __libc_lock_unlock (lock);