summaryrefslogtreecommitdiff
path: root/community/pam_pwcheck/pam_pwcheck-3.9-pthread.patch
blob: ef007b46945094511ad44e07213a9553bac37397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- pam_pwcheck-3.9.orig/src/read-files.c	2005-10-10 13:38:30.000000000 -0500
+++ pam_pwcheck-3.9/src/read-files.c	2012-12-25 05:23:41.175269985 -0500
@@ -30,8 +30,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <nss.h>
-#include <bits/libc-lock.h>
-#define __libc_lock_t pthread_mutex_t
+#include <pthread.h>
 
 #include "read-files.h"
 
@@ -341,11 +340,11 @@
 		  char *buffer, size_t buflen, int *errnop)
 {
   /* Locks the static variables in this file.  */
-  __libc_lock_define_initialized (static, lock);
+  static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
   enum nss_status status;
   FILE *stream = NULL;
 
-  __libc_lock_lock (lock);
+  pthread_mutex_lock (&lock);
 
   status = internal_setent (&stream, "/shadow");
   if (status == NSS_STATUS_SUCCESS)
@@ -361,7 +360,7 @@
       internal_endent (&stream);
     }
 
-  __libc_lock_unlock (lock);
+  pthread_mutex_unlock (&lock);
 
   return status;
 }
@@ -371,11 +370,11 @@
 		  char *buffer, size_t buflen, int *errnop)
 {
   /* Locks the static variables in this file.  */
-  __libc_lock_define_initialized (static, lock);
+  static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
   enum nss_status status;
   FILE *stream = NULL;
 
-  __libc_lock_lock (lock);
+  pthread_mutex_lock (&lock);
 
   status = internal_setent (&stream, "/passwd");
   if (status == NSS_STATUS_SUCCESS)
@@ -391,7 +390,7 @@
       internal_endent (&stream);
     }
 
-  __libc_lock_unlock (lock);
+  pthread_mutex_unlock (&lock);
 
   return status;
 }