summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-05-07 15:54:24 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-05-07 15:54:24 +0000
commit2719d5eda977dc8731c77147bfc91c1338ab615d (patch)
tree456421dee001c8c11e31326e882f3c86354cc89b /sys
parentcfb7c2f300468ad65ba289333eb4a608987ad55f (diff)
rw_enter() with RW_NOSLEEP returns EBUSY and not the expected EWOULDBLOCK
This fixes random gmake failures during ports builds caused by: gmake[2]: *** read jobs pipe: Device busy. Stop. Fix verified by tb@ on his bulk build box OK mvs@ tb@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_socket2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index e8401225fdb..96e24f8d3d9 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.153 2024/05/03 17:43:09 mvs Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.154 2024/05/07 15:54:23 claudio Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -552,7 +552,10 @@ sblock(struct socket *so, struct sockbuf *sb, int flags)
if (!(flags & SBL_WAIT))
rwflags |= RW_NOSLEEP;
- return rw_enter(&sb->sb_lock, rwflags);
+ error = rw_enter(&sb->sb_lock, rwflags);
+ if (error == EBUSY)
+ error = EWOULDBLOCK;
+ return error;
}
soassertlocked(so);