summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/uthread_wait4.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/uthread/uthread_wait4.c')
-rw-r--r--lib/libpthread/uthread/uthread_wait4.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpthread/uthread/uthread_wait4.c b/lib/libpthread/uthread/uthread_wait4.c
index 0c3efa803f2..b51d6b29d6c 100644
--- a/lib/libpthread/uthread/uthread_wait4.c
+++ b/lib/libpthread/uthread/uthread_wait4.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_wait4.c,v 1.5 1999/11/25 07:01:47 d Exp $ */
+/* $OpenBSD: uthread_wait4.c,v 1.6 2001/08/21 19:24:53 fgsch Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -41,6 +41,7 @@
pid_t
wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
{
+ struct pthread *curthread = _get_curthread();
pid_t ret;
/* This is a cancellation point: */
@@ -51,13 +52,13 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
/* Perform a non-blocking wait4 syscall: */
while ((ret = _thread_sys_wait4(pid, istat, options | WNOHANG, rusage)) == 0 && (options & WNOHANG) == 0) {
/* Reset the interrupted operation flag: */
- _thread_run->interrupted = 0;
+ curthread->interrupted = 0;
/* Schedule the next thread while this one waits: */
_thread_kern_sched_state(PS_WAIT_WAIT, __FILE__, __LINE__);
/* Check if this call was interrupted by a signal: */
- if (_thread_run->interrupted) {
+ if (curthread->interrupted) {
errno = EINTR;
ret = -1;
break;