提交 d0b547df 编写于 作者: R Rich Felker

fix regression in select with no timeout

commit 722a1ae3 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.
上级 e408deef
......@@ -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 }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册