mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-14 21:42:19 +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
Notes:
sideshowbarker
2024-07-19 03:54:27 +09:00
Author: https://github.com/alimpfard
Commit: 69fc91d974
Pull-request: https://github.com/SerenityOS/serenity/pull/3078
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