summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/pselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/pselect.c')
-rw-r--r--libc/sysdeps/linux/common/pselect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/pselect.c b/libc/sysdeps/linux/common/pselect.c
index fbe85b780..bf2c08375 100644
--- a/libc/sysdeps/linux/common/pselect.c
+++ b/libc/sysdeps/linux/common/pselect.c
@@ -36,10 +36,6 @@ static int __NC(pselect)(int nfds, fd_set *readfds, fd_set *writefds,
*/
struct timespec _ts;
- if (timeout != NULL) {
- _ts = *timeout;
- timeout = &_ts;
- }
/* Note: the system call expects 7 values but on most architectures
we can only pass in 6 directly. If there is an architecture with
support for more parameters a new version of this file needs to
@@ -49,6 +45,11 @@ static int __NC(pselect)(int nfds, fd_set *readfds, fd_set *writefds,
__kernel_size_t ss_len;
} data;
+ if (timeout != NULL) {
+ _ts = *timeout;
+ timeout = &_ts;
+ }
+
if (sigmask != NULL) {
data.ss = (__kernel_ulong_t) sigmask;
data.ss_len = __SYSCALL_SIGSET_T_SIZE;