summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_readv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_readv.c')
-rw-r--r--lib/libc_r/uthread/uthread_readv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_readv.c b/lib/libc_r/uthread/uthread_readv.c
index 4a91f7cb887..05661166b4c 100644
--- a/lib/libc_r/uthread/uthread_readv.c
+++ b/lib/libc_r/uthread/uthread_readv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_readv.c,v 1.4 2001/08/17 06:52:23 fgsch Exp $ */
+/* $OpenBSD: uthread_readv.c,v 1.5 2001/08/21 19:24:53 fgsch Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -45,6 +45,7 @@
ssize_t
readv(int fd, const struct iovec * iov, int iovcnt)
{
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
int type;
@@ -65,11 +66,11 @@ readv(int fd, const struct iovec * iov, int iovcnt)
while ((ret = _thread_sys_readv(fd, iov, iovcnt)) < 0) {
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
- _thread_run->data.fd.fd = fd;
+ curthread->data.fd.fd = fd;
_thread_kern_set_timeout(NULL);
/* Reset the interrupted operation flag: */
- _thread_run->interrupted = 0;
+ curthread->interrupted = 0;
_thread_kern_sched_state(PS_FDR_WAIT,
__FILE__, __LINE__);
@@ -78,7 +79,7 @@ readv(int fd, const struct iovec * iov, int iovcnt)
* Check if the operation was
* interrupted by a signal
*/
- if (_thread_run->interrupted) {
+ if (curthread->interrupted) {
errno = EINTR;
ret = -1;
break;