Lines 1-18
Link Here
|
1 |
--- plib/support.c.orig Thu Jan 9 14:25:01 2003 |
1 |
--- plib/support.c.orig Thu Jan 9 22:25:01 2003 |
2 |
+++ plib/support.c Mon May 23 20:46:01 2005 |
2 |
+++ plib/support.c Wed Apr 6 00:38:41 2005 |
3 |
@@ -145,6 +145,15 @@ |
3 |
@@ -369,11 +369,13 @@ |
4 |
pthread_mutex_init(&pwd_lock, NULL); |
4 |
return code; |
5 |
} |
5 |
|
|
|
6 |
#else |
7 |
+ pthread_once_t grp_once; |
8 |
+ pthread_mutex_t grp_lock; |
9 |
struct group *gp; |
10 |
int i, len; |
6 |
|
11 |
|
7 |
+static pthread_mutex_t grp_lock; |
12 |
|
8 |
+static pthread_once_t grp_once = PTHREAD_ONCE_INIT; |
13 |
- pthread_once(&grp_once, grp_lock_init); |
9 |
+ |
14 |
+ pthread_once(&grp_once, NULL); |
10 |
+static void |
15 |
pthread_mutex_lock(&grp_lock); |
11 |
+grp_lock_init(void) |
16 |
|
12 |
+{ |
17 |
gp = getgrgid(gid); |
13 |
+ pthread_mutex_init(&grp_lock, NULL); |
18 |
@@ -452,11 +454,13 @@ |
14 |
+} |
19 |
return code; |
15 |
+ |
20 |
|
16 |
static char * |
21 |
#else |
17 |
strcopy(const char *str, char **buf, size_t *avail) |
22 |
+ pthread_once_t grp_once; |
18 |
{ |
23 |
+ pthread_mutex_t grp_lock; |
|
|
24 |
struct group *gp; |
25 |
int i, len; |
26 |
|
27 |
|
28 |
- pthread_once(&grp_once, grp_lock_init); |
29 |
+ pthread_once(&grp_once, NULL); |
30 |
pthread_mutex_lock(&grp_lock); |
31 |
|
32 |
gp = getgrnam(name); |