]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix JSON output in .status dir running
authorEric Bollengier <eric@baculasystems.com>
Thu, 23 Nov 2023 09:50:45 +0000 (10:50 +0100)
committerEric Bollengier <eric@baculasystems.com>
Tue, 13 Feb 2024 09:36:02 +0000 (10:36 +0100)
bacula/src/dird/ua_status.c

index 5ccea0d63cd3ffcd11c4ee78b3bf0572c760252d..37e16ff9fa2ed6dfe90678868ce4b16fbe6a17dc 100644 (file)
@@ -1581,18 +1581,16 @@ static void list_running_jobs(UAContext *ua)
       ua->send_msg("%s", ow.end_group());
    }
 
-   if (njobs == 0) {
-      /* Note the following message is used in regress -- don't change */
-      ua->send_msg(_("No Jobs running.\n====\n"));
-      Dmsg0(200, "leave list_run_jobs()\n");
-      return;
-   } else {
-      /* display a closing header */
-      if (!ua->api) {
+   if (!ua->api) {
+      if (njobs == 0) {
+        /* Note the following message is used in regress -- don't change */
+        ua->send_msg(_("No Jobs running.\n====\n"));
+        return;;
+      } else {
+        /* display a closing header */
          ua->send_msg("====\n");
       }
    }
-   Dmsg0(200, "leave list_run_jobs()\n");
 }
 
 static void list_terminated_jobs(UAContext *ua)