From a227aa89418f51ee7e18f1030b9860ffef8483b6 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Fri, 13 Jun 2003 21:46:55 +0000
Subject: [PATCH] Report completing jobs by default, properly filter for job
 state COMPLETING.

---
 src/squeue/print.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/squeue/print.c b/src/squeue/print.c
index 503a685f37f..cf2f4447c5d 100644
--- a/src/squeue/print.c
+++ b/src/squeue/print.c
@@ -877,7 +877,9 @@ static int _filter_job(job_info_t * job)
 		filter = 1;
 		iterator = list_iterator_create(params.state_list);
 		while ((state_id = list_next(iterator))) {
-			if (*state_id == job->job_state) {
+			if ((*state_id == job->job_state) ||
+			    ((*state_id == JOB_COMPLETING) && 
+			     (*state_id & job->job_state))) {
 				filter = 0;
 				break;
 			}
@@ -887,7 +889,8 @@ static int _filter_job(job_info_t * job)
 			return 3;
 	} else {
 		if ((job->job_state != JOB_PENDING) &&
-		    (job->job_state != JOB_RUNNING))
+		    (job->job_state != JOB_RUNNING) &&
+		    ((job->job_state & JOB_COMPLETING) == 0))
 			return 4;
 	}
 
-- 
GitLab