diff options
| author | 2020-01-21 23:59:20 +0000 | |
|---|---|---|
| committer | 2020-01-21 23:59:20 +0000 | |
| commit | e43431d149e2a0cf563b4bc2652ecf5c5e74df4b (patch) | |
| tree | 0e99ecd1e0980e681f01ae0127029f4c336cdf66 /usr.sbin/bind/lib/isc/unix/strerror.c | |
| parent | Connect netcat client to server and close stdin. Then netcat waits (diff) | |
| download | wireguard-openbsd-e43431d149e2a0cf563b4bc2652ecf5c5e74df4b.tar.xz wireguard-openbsd-e43431d149e2a0cf563b4bc2652ecf5c5e74df4b.zip | |
remove mutex.h etc. since this code is now unthreaded.
ok florian
Diffstat (limited to 'usr.sbin/bind/lib/isc/unix/strerror.c')
| -rw-r--r-- | usr.sbin/bind/lib/isc/unix/strerror.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/strerror.c b/usr.sbin/bind/lib/isc/unix/strerror.c index 809a4f751b6..16a7fdb0e14 100644 --- a/usr.sbin/bind/lib/isc/unix/strerror.c +++ b/usr.sbin/bind/lib/isc/unix/strerror.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: strerror.c,v 1.5 2020/01/20 18:51:53 florian Exp $ */ +/* $Id: strerror.c,v 1.6 2020/01/21 23:59:20 tedu Exp $ */ /*! \file */ @@ -23,35 +23,19 @@ #include <stdio.h> #include <string.h> -#include <isc/mutex.h> -#include <isc/once.h> - #include <isc/strerror.h> #include <isc/util.h> -/*% - * We need to do this this way for profiled locks. - */ -static isc_mutex_t isc_strerror_lock; -static void init_lock(void) { - RUNTIME_CHECK(isc_mutex_init(&isc_strerror_lock) == ISC_R_SUCCESS); -} - void isc__strerror(int num, char *buf, size_t size) { char *msg; unsigned int unum = (unsigned int)num; - static isc_once_t once = ISC_ONCE_INIT; REQUIRE(buf != NULL); - RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS); - - LOCK(&isc_strerror_lock); msg = strerror(num); if (msg != NULL) snprintf(buf, size, "%s", msg); else snprintf(buf, size, "Unknown error: %u", unum); - UNLOCK(&isc_strerror_lock); } |
