diff options
author | 2003-01-19 21:22:31 +0000 | |
---|---|---|
committer | 2003-01-19 21:22:31 +0000 | |
commit | 039102577c28982f9651ba0897198277bd31ad9c (patch) | |
tree | d1f5ce444defba4df06a3967020f5d3805985d1e /lib/libpthread/uthread | |
parent | typos; jmc@prioris.mini.pw.edu.pl (diff) | |
download | wireguard-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')
-rw-r--r-- | lib/libpthread/uthread/uthread_fd.c | 5 | ||||
-rw-r--r-- | lib/libpthread/uthread/uthread_select.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/libpthread/uthread/uthread_fd.c b/lib/libpthread/uthread/uthread_fd.c index 12b325c93d9..5a998fbba7e 100644 --- a/lib/libpthread/uthread/uthread_fd.c +++ b/lib/libpthread/uthread/uthread_fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_fd.c,v 1.15 2002/11/12 20:12:45 marc Exp $ */ +/* $OpenBSD: uthread_fd.c,v 1.16 2003/01/19 21:22:31 marc Exp $ */ /* * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> * All rights reserved. @@ -269,8 +269,7 @@ void _thread_fd_unlock(int fd, int lock_type, const char *fname, int lineno) { struct pthread *curthread = _get_curthread(); - return (_thread_fd_unlock_thread(curthread, fd, lock_type, - fname, lineno)); + _thread_fd_unlock_thread(curthread, fd, lock_type, fname, lineno); } /* 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 |