git: be90f23d4a6c - main - libthr: libpthread/t_mutex.c tests should expect EDEADLK

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 10 Nov 2026 00:22:17 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=be90f23d4a6c70cd829366612c53755b47c2986d

commit be90f23d4a6c70cd829366612c53755b47c2986d
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-11-09 19:17:20 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-10 00:21:19 +0000

    libthr: libpthread/t_mutex.c tests should expect EDEADLK
    
    to follow the POSIX specification.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D61253
---
 contrib/netbsd-tests/lib/libpthread/t_mutex.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/contrib/netbsd-tests/lib/libpthread/t_mutex.c b/contrib/netbsd-tests/lib/libpthread/t_mutex.c
index ad841142f426..83f95be441f4 100644
--- a/contrib/netbsd-tests/lib/libpthread/t_mutex.c
+++ b/contrib/netbsd-tests/lib/libpthread/t_mutex.c
@@ -720,9 +720,10 @@ ATF_TC_BODY(timedmutex1, tc)
 	printf("Before acquiring mutex\n");
 	PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
 
-	printf("Before endeavor to reacquire timed-mutex (timeout expected)\n");
+	printf("Before endeavor to reacquire timed-mutex "
+	    "(deadlock detected)\n");
 	PTHREAD_REQUIRE_STATUS(mutex_lock(&mutex, &ts_shortlived),
-	    ETIMEDOUT);
+	    EDEADLK);
 
 	printf("Unlocking mutex\n");
 	PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
@@ -745,9 +746,10 @@ ATF_TC_BODY(timedmutex2, tc)
 	printf("Before acquiring mutex with timedlock\n");
 	PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
 
-	printf("Before endeavor to reacquire timed-mutex (timeout expected)\n");
+	printf("Before endeavor to reacquire timed-mutex "
+	    "(deadlock detected)\n");
 	PTHREAD_REQUIRE_STATUS(mutex_lock(&mutex, &ts_shortlived),
-	    ETIMEDOUT);
+	    EDEADLK);
 
 	printf("Unlocking mutex\n");
 	PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));