summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_kevent.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_kevent.c')
-rw-r--r--lib/libc_r/uthread/uthread_kevent.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/libc_r/uthread/uthread_kevent.c b/lib/libc_r/uthread/uthread_kevent.c
index 0985d05d38a..909f92366db 100644
--- a/lib/libc_r/uthread/uthread_kevent.c
+++ b/lib/libc_r/uthread/uthread_kevent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_kevent.c,v 1.1 2001/08/15 23:50:34 fgsch Exp $ */
+/* $OpenBSD: uthread_kevent.c,v 1.2 2001/08/21 19:24:53 fgsch Exp $ */
/*-
* Copyright (c) 2000 Jonathan Lemon <jlemon@flugsvamp.com>
* All rights reserved.
@@ -40,6 +40,7 @@ int
kevent(int kq, const struct kevent *changelist, int nchanges,
struct kevent *eventlist, int nevents, const struct timespec *timeout)
{
+ struct pthread *curthread = _get_curthread();
struct timespec nullts = { 0, 0 };
int rc;
@@ -51,26 +52,26 @@ kevent(int kq, const struct kevent *changelist, int nchanges,
if (rc == 0 && (timeout == NULL ||
timeout->tv_sec != 0 || timeout->tv_nsec != 0)) {
/* Save the socket file descriptor: */
- _thread_run->data.fd.fd = kq;
- _thread_run->data.fd.fname = __FILE__;
- _thread_run->data.fd.branch = __LINE__;
+ curthread->data.fd.fd = kq;
+ curthread->data.fd.fname = __FILE__;
+ curthread->data.fd.branch = __LINE__;
do {
/* Reset the interrupted and timeout flags: */
- _thread_run->interrupted = 0;
- _thread_run->timeout = 0;
+ curthread->interrupted = 0;
+ curthread->timeout = 0;
_thread_kern_sched_state(PS_FDR_WAIT,
__FILE__, __LINE__);
- if (_thread_run->interrupted) {
+ if (curthread->interrupted) {
errno = EINTR;
rc = -1;
break;
}
rc = _thread_sys_kevent(kq, NULL, 0,
eventlist, nevents, &nullts);
- } while (rc == 0 && _thread_run->timeout == 0);
+ } while (rc == 0 && curthread->timeout == 0);
}
return (rc);
}