mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 18:03:37 +08:00
Reap jobs before calling select() in job_continue()
Prior to b0e09303a
, simple jobs like `printf "%s\n" $line | read word _`
never hit the call to select() because they were reaped in the SIGCHLD
signal handler. With that commit, the signal handler no longer reaps
children, and a job like that would enter select() and hit the 10000μs
timeout before discovering that the job was already complete.
Fixes #1884.
This commit is contained in:
parent
34db67680d
commit
6e2132e01f
6
proc.cpp
6
proc.cpp
|
@ -1012,6 +1012,9 @@ static int select_try(job_t *j)
|
|||
tv.tv_usec=10000;
|
||||
|
||||
retval =select(maxfd+1, &fds, 0, 0, &tv);
|
||||
if (retval == 0) {
|
||||
debug(3, L"select_try hit timeout\n");
|
||||
}
|
||||
return retval > 0;
|
||||
}
|
||||
|
||||
|
@ -1224,6 +1227,9 @@ void job_continue(job_t *j, bool cont)
|
|||
{
|
||||
bool quit = false;
|
||||
|
||||
/* Look for finished processes first, to avoid select() if it's already done. */
|
||||
process_mark_finished_children(false);
|
||||
|
||||
/*
|
||||
Wait for job to report.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user