]>
Commit | Line | Data |
---|---|---|
d423733f AM |
1 | 2006-12-19 Jakub Jelinek <jakub@redhat.com> |
2 | ||
3 | * nss/getXXbyYY_r.c: Include atomic.h. | |
4 | (INTERNAL (REENTRANT_NAME)): Write startp after start_fct, | |
5 | add atomic_write_barrier () in between. | |
6 | ||
7 | --- libc/nss/getXXbyYY_r.c 16 Sep 2004 22:24:09 -0000 1.61 | |
8 | +++ libc/nss/getXXbyYY_r.c 19 Dec 2006 15:45:08 -0000 1.62 | |
9 | @@ -18,6 +18,7 @@ | |
10 | 02111-1307 USA. */ | |
11 | ||
12 | #include <assert.h> | |
13 | +#include <atomic.h> | |
14 | #include <errno.h> | |
15 | #include <stdbool.h> | |
16 | #include "nsswitch.h" | |
17 | @@ -173,9 +174,6 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L | |
18 | startp = (service_user *) -1l; | |
19 | else | |
20 | { | |
21 | - startp = nip; | |
22 | - start_fct = fct.l; | |
23 | - | |
24 | #ifdef NEED__RES | |
25 | /* The resolver code will really be used so we have to | |
26 | initialize it. */ | |
27 | @@ -190,6 +188,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L | |
28 | if (!_res_hconf.initialized) | |
29 | _res_hconf_init (); | |
30 | #endif /* need _res_hconf */ | |
31 | + | |
32 | + start_fct = fct.l; | |
33 | + /* Make sure start_fct is written before startp. */ | |
34 | + atomic_write_barrier (); | |
35 | + startp = nip; | |
36 | } | |
37 | } | |
38 | else |