]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* nss/getXXbyYY_r.c: Include atomic.h.
authorJakub Jelinek <jakub@redhat.com>
Fri, 12 Jan 2007 17:53:27 +0000 (17:53 +0000)
committerJakub Jelinek <jakub@redhat.com>
Fri, 12 Jan 2007 17:53:27 +0000 (17:53 +0000)
(INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
add atomic_write_barrier () in between.

ChangeLog
nss/getXXbyYY_r.c

index 3470783d368861e07d65518359e8c270aca72f6a..b4674852e35faf786ca8c6bb7378c7d0c715ddc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * nss/getXXbyYY_r.c: Include atomic.h.
+       (INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
+       add atomic_write_barrier () in between.
+
 2006-12-18  Jakub Jelinek  <jakub@redhat.com>
 
        [BZ #3747]
index 34c305f3b2f9616be194ab3e2dcdbbf624432c31..080163aac9162f5e2da63d138331c12ec4fb304f 100644 (file)
@@ -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