swrap: abort on mutex errors
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Feb 2021 10:50:17 +0000 (11:50 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 5 Feb 2021 13:11:31 +0000 (14:11 +0100)
There's no way to continue in a reliable way...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c

index 0f37605dd2bb2eddaf9a24a41986bc707ce6c924..00db6f0cb833066a749e7bf9939c06af58e2638d 100644 (file)
@@ -755,6 +755,7 @@ static void _swrap_mutex_lock(pthread_mutex_t *mutex, const char *name, const ch
        if (ret != 0) {
                SWRAP_LOG(SWRAP_LOG_ERROR, "PID(%d):PPID(%d): %s(%u): Couldn't lock pthread mutex(%s) - %s",
                          getpid(), getppid(), caller, line, name, strerror(ret));
+               abort();
        }
 }
 
@@ -767,6 +768,7 @@ static void _swrap_mutex_unlock(pthread_mutex_t *mutex, const char *name, const
        if (ret != 0) {
                SWRAP_LOG(SWRAP_LOG_ERROR, "PID(%d):PPID(%d): %s(%u): Couldn't unlock pthread mutex(%s) - %s",
                          getpid(), getppid(), caller, line, name, strerror(ret));
+               abort();
        }
 }