openap-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[openap-cvs] : bridge-utils/libbridge if_index.c,1.1.1.1,1.2


From: David Kimdon <address@hidden>
Subject: [openap-cvs] : bridge-utils/libbridge if_index.c,1.1.1.1,1.2
Date: Wed, 17 Jul 2002 08:33:57 -0400

Update of /cvsroot/openap/bridge-utils/libbridge
In directory subversions:/tmp/cvs-serv26145

Modified Files:
        if_index.c 
Log Message:
if_index.c : The new uClibc doesn't support bits/libc-lock.h anymore.  The
changelog not when it was removed says it wasn't working anyway.  Use
pthread_mutex(un)lock() instead.



Index: if_index.c
===================================================================
RCS file: /cvsroot/openap/bridge-utils/libbridge/if_index.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- if_index.c  7 May 2002 19:59:52 -0000       1.1.1.1
+++ if_index.c  17 Jul 2002 12:33:55 -0000      1.2
@@ -24,7 +24,7 @@
 #include <net/if.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <bits/libc-lock.h>
+#include <pthread.h>
 
 /* Try to get a socket to talk to the kernel.  */
 #if defined SIOCGIFINDEX || defined SIOCGIFNAME
@@ -36,7 +36,7 @@
      socket().  */
   static int sock_af = -1;
   int fd = -1;
-  __libc_lock_define_initialized (static, lock);
+  static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
 
   if (sock_af != -1)
     {
@@ -45,7 +45,7 @@
         return fd;
     }
 
-  __libc_lock_lock (lock);
+  pthread_mutex_lock(&lock);
 
   if (sock_af != -1)
     fd = __socket (sock_af, SOCK_DGRAM, 0);
@@ -63,7 +63,7 @@
        fd = __socket (sock_af = AF_APPLETALK, SOCK_DGRAM, 0);
     }
 
-  __libc_lock_unlock (lock);
+  pthread_mutex_unlock(&lock);
   return fd;
 }
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]