summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/uthread_sendmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/uthread/uthread_sendmsg.c')
-rw-r--r--lib/libpthread/uthread/uthread_sendmsg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_sendmsg.c b/lib/libpthread/uthread/uthread_sendmsg.c
index 7cfb714606a..2995af1e024 100644
--- a/lib/libpthread/uthread/uthread_sendmsg.c
+++ b/lib/libpthread/uthread/uthread_sendmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_sendmsg.c,v 1.6 2006/09/22 19:04:33 kurt Exp $ */
+/* $OpenBSD: uthread_sendmsg.c,v 1.7 2006/10/03 02:59:36 kurt Exp $ */
/*
* Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -58,6 +58,7 @@ sendmsg(int fd, const struct msghdr *msg, int flags)
/* Set the timeout: */
_thread_kern_set_timeout(NULL);
curthread->interrupted = 0;
+ curthread->closing_fd = 0;
_thread_kern_sched_state(PS_FDW_WAIT, __FILE__, __LINE__);
/* Check if the operation was interrupted: */
@@ -65,6 +66,10 @@ sendmsg(int fd, const struct msghdr *msg, int flags)
errno = EINTR;
ret = -1;
break;
+ } else if (curthread->closing_fd) {
+ errno = EBADF;
+ ret = -1;
+ break;
}
} else {
ret = -1;