summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread/uthread_select.c
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2003-01-19 21:22:31 +0000
committermarc <marc@openbsd.org>2003-01-19 21:22:31 +0000
commit039102577c28982f9651ba0897198277bd31ad9c (patch)
treed1f5ce444defba4df06a3967020f5d3805985d1e /lib/libpthread/uthread/uthread_select.c
parenttypos; jmc@prioris.mini.pw.edu.pl (diff)
downloadwireguard-openbsd-039102577c28982f9651ba0897198277bd31ad9c.tar.xz
wireguard-openbsd-039102577c28982f9651ba0897198277bd31ad9c.zip
return (func(...)) not needed when the current function and func
are both void. The select call is a cancellation point per IEEE Std 1003.1-2001. This should fix a problem espie@ found in kde.
Diffstat (limited to 'lib/libpthread/uthread/uthread_select.c')
-rw-r--r--lib/libpthread/uthread/uthread_select.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_select.c b/lib/libpthread/uthread/uthread_select.c
index 61708fa7c39..b4eb7efe7e4 100644
--- a/lib/libpthread/uthread/uthread_select.c
+++ b/lib/libpthread/uthread/uthread_select.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_select.c,v 1.5 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_select.c,v 1.6 2003/01/19 21:22:31 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -55,6 +55,9 @@ select(int numfds, fd_set * readfds, fd_set * writefds,
int pfd_index, got_one = 0, fd_count = 0;
struct pthread_poll_data data;
+ /* this is a cancellation point per IEEE Std 1003.1-2001 */
+ _thread_enter_cancellation_point();
+
if (numfds > _thread_dtablesize) {
numfds = _thread_dtablesize;
}
@@ -63,7 +66,8 @@ select(int numfds, fd_set * readfds, fd_set * writefds,
if (timeout->tv_sec < 0 ||
timeout->tv_usec < 0 || timeout->tv_usec >= 1000000) {
errno = EINVAL;
- return (-1);
+ ret = -1;
+ goto done;
}
/* Convert the timeval to a timespec: */
@@ -203,6 +207,9 @@ select(int numfds, fd_set * readfds, fd_set * writefds,
ret = numfds;
}
+done:
+ _thread_leave_cancellation_point();
+
return (ret);
}
#endif