]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/fd_cmds.c
update version
[bacula/bacula] / bacula / src / stored / fd_cmds.c
index 403957874b66fad432be8249201f1c8421b35060..992d705e4dacbc158e37212ad5b52979df3ae636 100644 (file)
@@ -159,23 +159,27 @@ void do_fd_commands(JCR *jcr)
          if (strncmp(fd_cmds[i].cmd, fd->msg, strlen(fd_cmds[i].cmd)) == 0) {
             found = true;               /* indicate command found */
             jcr->errmsg[0] = 0;
-            if (!fd_cmds[i].func(jcr) || job_canceled(jcr)) {    /* do command */
+            if (!fd_cmds[i].func(jcr)) {    /* do command */
                /* Note fd->msg command may be destroyed by comm activity */
-               if (jcr->errmsg[0]) {
-                  Jmsg1(jcr, M_FATAL, 0, _("Command error with FD, hanging up. %s\n"),
-                        jcr->errmsg);
-               } else {
-                  Jmsg0(jcr, M_FATAL, 0, _("Command error with FD, hanging up.\n"));
+               if (!job_canceled(jcr)) {
+                  if (jcr->errmsg[0]) {
+                     Jmsg1(jcr, M_FATAL, 0, _("Command error with FD, hanging up. %s\n"),
+                           jcr->errmsg);
+                  } else {
+                     Jmsg0(jcr, M_FATAL, 0, _("Command error with FD, hanging up.\n"));
+                  }
+                  set_jcr_job_status(jcr, JS_ErrorTerminated);
                }
-               set_jcr_job_status(jcr, JS_ErrorTerminated);
                quit = true;
             }
             break;
          }
       }
       if (!found) {                   /* command not found */
-         Jmsg1(jcr, M_FATAL, 0, _("FD command not found: %s\n"), fd->msg);
-         Dmsg1(110, "<filed: Command not found: %s\n", fd->msg);
+         if (!job_canceled(jcr)) {
+            Jmsg1(jcr, M_FATAL, 0, _("FD command not found: %s\n"), fd->msg);
+            Dmsg1(110, "<filed: Command not found: %s\n", fd->msg);
+         }
          fd->fsend(ferrmsg);
          break;
       }