From d7a1e1d121ed64b874aa012ab8142d41a1b6ec96 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 30 May 2004 18:45:24 +0000 Subject: [PATCH] Apply csh's open_bpipe error return fix. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1379 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/job.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 071d150e73..e08f11d4f6 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -438,6 +438,11 @@ static int run_cmd(JCR *jcr, char *cmd, const char *name) ecmd = edit_job_codes(jcr, ecmd, cmd, ""); bpipe = open_bpipe(ecmd, 0, "r"); free_pool_memory(ecmd); + if (bpipe == NULL) { + Jmsg(jcr, M_FATAL, 0, _("%s could not execute\n"), name); + set_jcr_job_status(jcr, JS_FatalError); + return 0; + } while (fgets(line, sizeof(line), bpipe->rfd)) { Jmsg(jcr, M_INFO, 0, _("%s: %s"), name, line); } -- 2.39.5