--- nss_db-2.2.3pre1/src/Makefile.am.external 2001-04-30 03:19:31.000000000 +0200 +++ nss_db-2.2.3pre1/src/Makefile.am 2004-03-20 11:27:24.000000000 +0100 @@ -11,7 +11,7 @@ noinst_HEADERS = db-compat.h netgroup.h nss_db.h -INCLUDES = @DB_CFLAGS@ -D_LIBC -D_GNU_SOURCE \ +INCLUDES = @DB_CFLAGS@ -D_GNU_SOURCE \ -I../intl -DLOCALEDIR=\"$(localedir)\" EXTRA_DIST = libnss_db.map --- nss_db-2.2.3pre1/src/db-XXX.c.external 2001-04-30 03:07:41.000000000 +0200 +++ nss_db-2.2.3pre1/src/db-XXX.c 2004-03-20 11:27:24.000000000 +0100 @@ -21,11 +21,10 @@ #include <ctype.h> #include <db.h> #include <netdb.h> +#include <pthread.h> #include <stdio.h> #include <string.h> -#include <bits/libc-lock.h> - #include "nss_db.h" /* These symbols are defined by the including source file: @@ -53,7 +52,7 @@ #endif /* Locks the static variables in this file. */ -__libc_lock_define_initialized (static, lock) +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* Maintenance of the shared handle open on the database. */ @@ -68,7 +67,7 @@ { enum nss_status status; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); status = internal_setent (DBFILE, &db); @@ -78,7 +77,7 @@ /* Reset the sequential index. */ entidx = 0; - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } @@ -88,14 +87,14 @@ enum nss_status CONCAT(_nss_db_end,ENTNAME) (void) { - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); internal_endent (&db); /* Reset STAYOPEN flag. */ keep_db = 0; - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return NSS_STATUS_SUCCESS; } @@ -227,10 +226,10 @@ key.data = alloca (size); \ key.size = KEYPRINTF keypattern; \ key.flags = 0; \ - __libc_lock_lock (lock); \ + pthread_mutex_lock (&lock); \ status = lookup (&key, result, buffer, buflen, errnop H_ERRNO_ARG \ EXTRA_ARGS_VALUE); \ - __libc_lock_unlock (lock); \ + pthread_mutex_unlock (&lock); \ return status; \ } @@ -249,7 +248,7 @@ char buf[20]; DBT key; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); /* Loop until we find a valid entry or hit EOF. See above for the special meaning of the status value. */ @@ -270,7 +269,7 @@ } while (status == NSS_STATUS_RETURN); - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } --- nss_db-2.2.3pre1/src/db-alias.c.external 2001-04-30 03:07:41.000000000 +0200 +++ nss_db-2.2.3pre1/src/db-alias.c 2004-03-20 11:27:24.000000000 +0100 @@ -23,15 +23,14 @@ #include <ctype.h> #include <errno.h> #include <paths.h> +#include <pthread.h> #include <stdio.h> #include <string.h> -#include <bits/libc-lock.h> - #include "nss_db.h" /* Locks the static variables in this file. */ -__libc_lock_define_initialized (static, lock) +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* Maintenance of the shared handle open on the database. */ @@ -46,7 +45,7 @@ { enum nss_status status; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); status = internal_setent (_PATH_VARDB "aliases.db", &db); @@ -57,7 +56,7 @@ /* Reset the sequential index. */ entidx = 0; - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } @@ -67,14 +66,14 @@ enum nss_status _nss_db_endaliasent (void) { - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); internal_endent (&db); /* Reset STAYOPEN flag. */ keep_db = 0; - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return NSS_STATUS_SUCCESS; } @@ -180,14 +179,14 @@ char buf[20]; DBT key; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); key.size = snprintf (key.data = buf, sizeof buf, "0%u", entidx++); key.flags = 0; status = lookup (&key, result, buffer, buflen, errnop); if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE) /* Give the user a chance to get the same entry with a larger buffer. */ --entidx; - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } @@ -207,9 +206,9 @@ memcpy (&((char *) key.data)[1], name, key.size - 1); key.flags = 0; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); status = lookup (&key, result, buffer, buflen, errnop); - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } --- nss_db-2.2.3pre1/src/db-netgrp.c.external 2001-04-30 03:07:41.000000000 +0200 +++ nss_db-2.2.3pre1/src/db-netgrp.c 2004-03-20 11:27:24.000000000 +0100 @@ -21,8 +21,8 @@ #include <errno.h> #include <fcntl.h> #include <netgroup.h> +#include <pthread.h> #include <string.h> -#include <bits/libc-lock.h> #include <paths.h> #include "nss_db.h" @@ -32,7 +32,7 @@ /* Locks the static variables in this file. */ -__libc_lock_define_initialized (static, lock) +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* Maintenance of the shared handle open on the database. */ static DB *db; @@ -44,7 +44,7 @@ { enum nss_status status; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); status = internal_setent (DBFILE, &db); @@ -60,7 +60,7 @@ cursor = entry = value.data; } - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; @@ -70,11 +70,11 @@ enum nss_status _nss_db_endnetgrent (void) { - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); internal_endent (&db); - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return NSS_STATUS_SUCCESS; } @@ -91,11 +91,11 @@ { int status; - __libc_lock_lock (lock); + pthread_mutex_lock (&lock); status = _nss_netgroup_parseline (&cursor, result, buffer, buflen, errnop); - __libc_lock_unlock (lock); + pthread_mutex_unlock (&lock); return status; } --- nss_db-2.2.3pre1/src/db-open.c.external 2001-04-30 03:07:41.000000000 +0200 +++ nss_db-2.2.3pre1/src/db-open.c 2004-03-20 11:27:24.000000000 +0100 @@ -58,7 +58,7 @@ if (err != 0) { if (err > 0) - __set_errno (err); + errno = err; return NSS_STATUS_UNAVAIL; } @@ -75,7 +75,7 @@ fail: db->close (db, 0); if (err > 0) - __set_errno (err); + errno = err; return NSS_STATUS_UNAVAIL; } --- nss_db-2.2.3pre1/src/Makefile.in.external 2001-04-30 19:07:40.000000000 +0200 +++ nss_db-2.2.3pre1/src/Makefile.in 2004-03-20 11:28:50.000000000 +0100 @@ -105,7 +105,7 @@ noinst_HEADERS = db-compat.h netgroup.h nss_db.h -INCLUDES = @DB_CFLAGS@ -D_LIBC -D_GNU_SOURCE -I../intl -DLOCALEDIR=\"$(localedir)\" +INCLUDES = @DB_CFLAGS@ -D_GNU_SOURCE -I../intl -DLOCALEDIR=\"$(localedir)\" EXTRA_DIST = libnss_db.map