mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Remove useless signal-checking loop in job_continue
This loop has always been nonsense.
This commit is contained in:
parent
182faca2e5
commit
e340baf6cc
1 changed files with 38 additions and 58 deletions
26
proc.cpp
26
proc.cpp
|
@ -83,11 +83,6 @@ Some of the code in this file is based on code from the Glibc manual.
|
|||
*/
|
||||
static int last_status=0;
|
||||
|
||||
/**
|
||||
Signal flag
|
||||
*/
|
||||
static sig_atomic_t got_signal=0;
|
||||
|
||||
bool job_list_is_empty(void)
|
||||
{
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
|
@ -647,7 +642,6 @@ void job_handle_signal(int signal, siginfo_t *info, void *con)
|
|||
{
|
||||
/* This is the only place that this generation count is modified. It's OK if it overflows. */
|
||||
s_sigchld_generation_count += 1;
|
||||
got_signal = 1;
|
||||
}
|
||||
|
||||
/* Given a command like "cat file", truncate it to a reasonable length */
|
||||
|
@ -1228,25 +1222,13 @@ void job_continue(job_t *j, bool cont)
|
|||
|
||||
if (job_get_flag(j, JOB_FOREGROUND))
|
||||
{
|
||||
int quit = 0;
|
||||
bool quit = false;
|
||||
|
||||
/*
|
||||
Wait for job to report. Looks a bit ugly because it has to
|
||||
handle the possibility that a signal is dispatched while
|
||||
running job_is_stopped().
|
||||
Wait for job to report.
|
||||
*/
|
||||
while (!quit)
|
||||
while (! job_is_stopped(j) && ! job_is_completed(j))
|
||||
{
|
||||
do
|
||||
{
|
||||
got_signal = 0;
|
||||
quit = job_is_stopped(j) || job_is_completed(j);
|
||||
}
|
||||
while (got_signal && !quit);
|
||||
|
||||
if (!quit)
|
||||
{
|
||||
|
||||
// debug( 1, L"select_try()" );
|
||||
switch (select_try(j))
|
||||
{
|
||||
|
@ -1292,8 +1274,6 @@ void job_continue(job_t *j, bool cont)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue