mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
Shell: Cancel a running for loop upon receiving any non-SIGINT signal
And keep the old behaviour of needing two interruptions on SIGINT.
This commit is contained in:
parent
d777583e28
commit
69fc91d974
1 changed files with 8 additions and 6 deletions
|
@ -777,13 +777,15 @@ RefPtr<Value> ForLoop::run(RefPtr<Shell> shell)
|
|||
if (!job || job->is_running_in_background())
|
||||
continue;
|
||||
shell->block_on_job(job);
|
||||
if (job->signaled()
|
||||
&& (job->termination_signal() == SIGINT
|
||||
|| job->termination_signal() == SIGKILL
|
||||
|| job->termination_signal() == SIGQUIT))
|
||||
++consecutive_interruptions;
|
||||
else
|
||||
|
||||
if (job->signaled()) {
|
||||
if (job->termination_signal() == SIGINT)
|
||||
++consecutive_interruptions;
|
||||
else
|
||||
break;
|
||||
} else {
|
||||
consecutive_interruptions = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue