From: Eric Bollengier Date: Thu, 23 Nov 2023 09:50:45 +0000 (+0100) Subject: Fix JSON output in .status dir running X-Git-Tag: Beta-15.0.1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28496a7433417e7cdb4f56328b22c48adc03e8ff;p=thirdparty%2Fbacula.git Fix JSON output in .status dir running --- diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index 5ccea0d63..37e16ff9f 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -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)