diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-08-07 02:57:53 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-08-07 02:57:53 -0400 |
commit | d0b547dfb5f7678cab6bc39dd736ed6454357ca4 (patch) | |
tree | e99011708d88b2d4c8c7d106865cb25793f3c5ae | |
parent | e408deefeb1a60b6e9e1bb63393590926f96ee64 (diff) | |
download | musl-d0b547dfb5f7678cab6bc39dd736ed6454357ca4.tar.gz musl-d0b547dfb5f7678cab6bc39dd736ed6454357ca4.tar.bz2 musl-d0b547dfb5f7678cab6bc39dd736ed6454357ca4.tar.xz musl-d0b547dfb5f7678cab6bc39dd736ed6454357ca4.zip |
fix regression in select with no timeout
commit 722a1ae3351a03ab25010dbebd492eced664853b inadvertently passed a
copy of {s,us} to the syscall even if the timeout argument tv was
null, thereby causing immediate timeout (polling) in place of
unlimited timeout. only archs using SYS_select were affected.
-rw-r--r-- | src/select/select.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/select/select.c b/src/select/select.c index e84c887f..8a786884 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -35,7 +35,8 @@ int select(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict return __syscall_ret(r); #endif #ifdef SYS_select - return syscall_cp(SYS_select, n, rfds, wfds, efds, ((long[]){s, us})); + return syscall_cp(SYS_select, n, rfds, wfds, efds, + tv ? ((long[]){s, us}) : 0); #else return syscall_cp(SYS_pselect6, n, rfds, wfds, efds, tv ? ((long[]){s, ns}) : 0, ((syscall_arg_t[]){ 0, _NSIG/8 })); |