summary refs log tree commit diff
path: root/nss/getXXbyYY_r.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /nss/getXXbyYY_r.c
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.xz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip
2.5-18.1
Diffstat (limited to 'nss/getXXbyYY_r.c')
-rw-r--r--nss/getXXbyYY_r.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index 34c305f3b2..080163aac9 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <assert.h>
+#include <atomic.h>
 #include <errno.h>
 #include <stdbool.h>
 #include "nsswitch.h"
@@ -173,9 +174,6 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 	startp = (service_user *) -1l;
       else
 	{
-	  startp = nip;
-	  start_fct = fct.l;
-
 #ifdef NEED__RES
 	  /* The resolver code will really be used so we have to
 	     initialize it.  */
@@ -190,6 +188,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 	  if (!_res_hconf.initialized)
 	    _res_hconf_init ();
 #endif /* need _res_hconf */
+
+	  start_fct = fct.l;
+	  /* Make sure start_fct is written before startp.  */
+	  atomic_write_barrier ();
+	  startp = nip;
 	}
     }
   else