mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 13:44:55 +00:00
Defer signals, so we will not wait for SIGCHLD after it was delivered.
This commit is contained in:
parent
ba965cf7cc
commit
db06cf96d5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48349
|
@ -41,6 +41,8 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
{
|
||||
pid_t ret;
|
||||
|
||||
_thread_kern_sig_defer();
|
||||
|
||||
/* Perform a non-blocking wait4 syscall: */
|
||||
while ((ret = _thread_sys_wait4(pid, istat, options | WNOHANG, rusage)) == 0 && (options & WNOHANG) == 0) {
|
||||
/* Reset the interrupted operation flag: */
|
||||
|
@ -56,6 +58,9 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_thread_kern_sig_undefer();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -41,6 +41,8 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
{
|
||||
pid_t ret;
|
||||
|
||||
_thread_kern_sig_defer();
|
||||
|
||||
/* Perform a non-blocking wait4 syscall: */
|
||||
while ((ret = _thread_sys_wait4(pid, istat, options | WNOHANG, rusage)) == 0 && (options & WNOHANG) == 0) {
|
||||
/* Reset the interrupted operation flag: */
|
||||
|
@ -56,6 +58,9 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_thread_kern_sig_undefer();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -41,6 +41,8 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
{
|
||||
pid_t ret;
|
||||
|
||||
_thread_kern_sig_defer();
|
||||
|
||||
/* Perform a non-blocking wait4 syscall: */
|
||||
while ((ret = _thread_sys_wait4(pid, istat, options | WNOHANG, rusage)) == 0 && (options & WNOHANG) == 0) {
|
||||
/* Reset the interrupted operation flag: */
|
||||
|
@ -56,6 +58,9 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_thread_kern_sig_undefer();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue