]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply csh's open_bpipe error return fix.
authorKern Sibbald <kern@sibbald.com>
Sun, 30 May 2004 18:45:24 +0000 (18:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 30 May 2004 18:45:24 +0000 (18:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1379 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/job.c

index 071d150e736329b75a9f804eb1952cd4631dbdc6..e08f11d4f61549e542d3a58a85d1daf251969b9c 100644 (file)
@@ -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);
    }