]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/fd_cmds.c
Simplify two messages in acquire.c
[bacula/bacula] / bacula / src / stored / fd_cmds.c
index 226355beb4982ef091c44f7ed4d8f851d217a91d..9987753720eef5babe33449bc702771dcc52936a 100644 (file)
@@ -11,7 +11,7 @@
  * 
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -77,7 +77,7 @@ static struct s_cmds fd_cmds[] = {
 };
 
 /* Commands from the File daemon that require additional scanning */
-static char read_open[]       = "read open session = %s %ld %ld %ld %ld %ld %ld\n";
+static char read_open[]       = "read open session = %127s %ld %ld %ld %ld %ld %ld\n";
 
 /* Responses sent to the File daemon */
 static char NO_open[]         = "3901 Error session already open\n";
@@ -117,7 +117,7 @@ void run_job(JCR *jcr)
    bnet_fsend(dir, Job_start, jcr->Job); 
    jcr->start_time = time(NULL);
    jcr->run_time = jcr->start_time;
-   jcr->JobStatus = JS_Running;
+   set_jcr_job_status(jcr, JS_Running);
    dir_send_job_status(jcr);         /* update director */
    for (quit=0; !quit;) {
       int stat;
@@ -136,7 +136,7 @@ void run_job(JCR *jcr)
         if (strncmp(fd_cmds[i].cmd, fd->msg, strlen(fd_cmds[i].cmd)) == 0) {
            found = 1;               /* indicate command found */
            if (!fd_cmds[i].func(jcr)) {    /* do command */
-              jcr->JobStatus = JS_ErrorTerminated;
+              set_jcr_job_status(jcr, JS_ErrorTerminated);
               quit = 1;
            }
            break;
@@ -150,9 +150,7 @@ void run_job(JCR *jcr)
    }
    bnet_sig(fd, BNET_TERMINATE);      /* signal to FD job is done */
    jcr->end_time = time(NULL);
-   if (!job_cancelled(jcr)) {
-      jcr->JobStatus = JS_Terminated;
-   }
+   set_jcr_job_status(jcr, JS_Terminated);
    bnet_fsend(dir, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
       edit_uint64(jcr->JobBytes, ec1));
 
@@ -178,6 +176,7 @@ static int append_data_cmd(JCR *jcr)
         jcr->JobType = JT_BACKUP;
         return 1;
       } else {
+        bnet_suppress_error_messages(fd, 1); /* ignore errors at this point */
         bnet_fsend(fd, ERROR_append);
         return 0;
       }
@@ -238,9 +237,6 @@ static int append_close_session(JCR *jcr)
       bnet_fsend(fd, NOT_opened);
       return 0;
    }
-   if (jcr->JobStatus != JS_ErrorTerminated) {
-      jcr->JobStatus = JS_Terminated;
-   }
    /* Send final statistics to File daemon */
    bnet_fsend(fd, OK_close, jcr->JobStatus);
    Dmsg1(160, ">filed: %s\n", fd->msg);