improve sanity check code

This commit is contained in:
Kurtis Rader
2017-01-24 15:14:56 -08:00
parent 3e10640c04
commit 319e65af05
3 changed files with 7 additions and 10 deletions

View File

@@ -984,18 +984,16 @@ int proc_format_status(int status) {
}
void proc_sanity_check() {
job_t *j;
job_t *fg_job = 0;
job_t *fg_job = NULL;
job_iterator_t jobs;
while ((j = jobs.next())) {
while (job_t *j = jobs.next()) {
if (!job_get_flag(j, JOB_CONSTRUCTED)) continue;
// More than one foreground job?
if (job_get_flag(j, JOB_FOREGROUND) && !(job_is_stopped(j) || job_is_completed(j))) {
if (fg_job != 0) {
if (fg_job) {
debug(0, _(L"More than one job in foreground: job 1: '%ls' job 2: '%ls'"),
fg_job->command_wcstr(), j->command_wcstr());
sanity_lose();