1 diff -urN pwdutils-3.2.19/lib/read-files.c pwdutils-3.2.19.new/lib/read-files.c
2 --- pwdutils-3.2.19/lib/read-files.c 2006-11-29 14:18:52.000000000 +0100
3 +++ pwdutils-3.2.19.new/lib/read-files.c 2013-02-04 20:09:27.318544396 +0100
8 -#include <bits/libc-lock.h>
9 -#define __libc_lock_t pthread_mutex_t
12 #include "read-files.h"
15 char *buffer, size_t buflen, int *errnop)
17 /* Locks the static variables in this file. */
18 - __libc_lock_define_initialized (static, lock)
19 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
20 enum nss_status status;
23 - __libc_lock_lock (lock);
24 + pthread_mutex_lock (&lock);
26 status = internal_setent (&stream, "/shadow");
27 if (status == NSS_STATUS_SUCCESS)
29 internal_endent (&stream);
32 - __libc_lock_unlock (lock);
33 + pthread_mutex_unlock (&lock);
38 char *buffer, size_t buflen, int *errnop)
40 /* Locks the static variables in this file. */
41 - __libc_lock_define_initialized (static, lock)
42 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
43 enum nss_status status;
46 - __libc_lock_lock (lock);
47 + pthread_mutex_lock (&lock);
49 status = internal_setent (&stream, "/passwd");
50 if (status == NSS_STATUS_SUCCESS)
52 internal_endent (&stream);
55 - __libc_lock_unlock (lock);
56 + pthread_mutex_unlock (&lock);
61 size_t buflen, int *errnop)
63 /* Locks the static variables in this file. */
64 - __libc_lock_define_initialized (static, lock)
65 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
66 enum nss_status status;
69 - __libc_lock_lock (lock);
70 + pthread_mutex_lock (&lock);
72 status = internal_setent (&stream, "/passwd");
73 if (status == NSS_STATUS_SUCCESS)
75 internal_endent (&stream);
78 - __libc_lock_unlock (lock);
79 + pthread_mutex_unlock (&lock);
84 size_t buflen, int *errnop)
86 /* Some static variables */
87 - __libc_lock_define_initialized (static, lock)
88 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
90 static fpos_t position;
92 /* Return next entry in host file. */
93 enum nss_status status = NSS_STATUS_SUCCESS;
95 - __libc_lock_lock (lock);
96 + pthread_mutex_lock (&lock);
98 /* Be prepared that the set*ent function was not called before. */
104 - __libc_lock_unlock (lock);
105 + pthread_mutex_unlock (&lock);
109 @@ -325,14 +324,14 @@
110 size_t buflen, int *errnop)
112 /* Some static variables */
113 - __libc_lock_define_initialized (static, lock)
114 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
116 static fpos_t position;
118 /* Return next entry in host file. */
119 enum nss_status status = NSS_STATUS_SUCCESS;
121 - __libc_lock_lock (lock);
122 + pthread_mutex_lock (&lock);
124 /* Be prepared that the set*ent function was not called before. */
130 - __libc_lock_unlock (lock);
131 + pthread_mutex_unlock (&lock);
135 diff -urN pwdutils-3.2.19/lib/read-files-group.c pwdutils-3.2.19.new/lib/read-files-group.c
136 --- pwdutils-3.2.19/lib/read-files-group.c 2006-11-29 14:18:54.000000000 +0100
137 +++ pwdutils-3.2.19.new/lib/read-files-group.c 2013-02-04 20:12:50.297444765 +0100
142 -#include <bits/libc-lock.h>
143 -#define __libc_lock_t pthread_mutex_t
144 +#include <pthread.h>
146 #include "read-files.h"
148 @@ -138,11 +137,11 @@
149 char *buffer, size_t buflen, int *errnop)
151 /* Locks the static variables in this file. */
152 - __libc_lock_define_initialized (static, lock)
153 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
154 enum nss_status status;
157 - __libc_lock_lock (lock);
158 + pthread_mutex_lock (&lock);
160 status = internal_setent (&stream, "/group");
161 if (status == NSS_STATUS_SUCCESS)
163 internal_endent (&stream);
166 - __libc_lock_unlock (lock);
167 + pthread_mutex_unlock (&lock);
171 @@ -168,11 +167,11 @@
172 size_t buflen, int *errnop)
174 /* Locks the static variables in this file. */
175 - __libc_lock_define_initialized (static, lock)
176 + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
177 enum nss_status status;
180 - __libc_lock_lock (lock);
181 + pthread_mutex_lock (&lock);
183 status = internal_setent (&stream, "/group");
184 if (status == NSS_STATUS_SUCCESS)
185 @@ -188,12 +187,12 @@
186 internal_endent (&stream);
189 - __libc_lock_unlock (lock);
190 + pthread_mutex_unlock (&lock);
195 -__libc_lock_define_initialized (static, lock);
196 +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
198 static fpos_t position;
201 /* Return next entry in host file. */
202 enum nss_status status = NSS_STATUS_SUCCESS;
204 - __libc_lock_lock (lock);
205 + pthread_mutex_lock (&lock);
207 /* Be prepared that the set*ent function was not called before. */
213 - __libc_lock_unlock (lock);
214 + pthread_mutex_unlock (&lock);