summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2003-01-19 21:22:32 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2003-01-19 21:22:32 +0000
commit0c99ae075c7b7425f108d8816ff2de6afcd15796 (patch)
tree75c2566039ae8d6095166168030b11765c51593a /lib/libc_r/uthread
parentd970efb1a2a7ce2878808b2d89dddb4b8d74a9fb (diff)
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/libc_r/uthread')
-rw-r--r--lib/libc_r/uthread/uthread_fd.c5
-rw-r--r--lib/libc_r/uthread/uthread_select.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/libc_r/uthread/uthread_fd.c b/lib/libc_r/uthread/uthread_fd.c
index 12b325c93d9..5a998fbba7e 100644
--- a/lib/libc_r/uthread/uthread_fd.c
+++ b/lib/libc_r/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/libc_r/uthread/uthread_select.c b/lib/libc_r/uthread/uthread_select.c
index 61708fa7c39..b4eb7efe7e4 100644
--- a/lib/libc_r/uthread/uthread_select.c
+++ b/lib/libc_r/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