]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/fd_cmds.c
ebl Fix a bug in read_close_session which return random status
[bacula/bacula] / bacula / src / stored / fd_cmds.c
index 78a59331c9b45a38e7f856e346cc4dec628a9145..8bbddbcd31bfd836d68ed3dcc0ede23b1ed25685 100644 (file)
@@ -21,8 +21,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -118,7 +118,7 @@ void run_job(JCR *jcr)
    BSOCK *dir = jcr->dir_bsock;
    char ec1[30];
 
-   dir->jcr = jcr;
+   dir->set_jcr(jcr);
    Dmsg1(120, "Start run Job=%s\n", jcr->Job);
    bnet_fsend(dir, Job_start, jcr->Job);
    jcr->start_time = time(NULL);
@@ -145,7 +145,7 @@ void do_fd_commands(JCR *jcr)
    bool found, quit;
    BSOCK *fd = jcr->file_bsock;
 
-   fd->jcr = jcr;
+   fd->set_jcr(jcr);
    for (quit=false; !quit;) {
       int stat;
 
@@ -193,9 +193,6 @@ static bool append_data_cmd(JCR *jcr)
       jcr->JobType = JT_BACKUP;
       if (do_append_data(jcr)) {
          return true;
-#ifdef xxx 
-         return bnet_fsend(fd, OK_append);
-#endif
       } else {
          bnet_suppress_error_messages(fd, 1); /* ignore errors at this point */
          bnet_fsend(fd, ERROR_append);
@@ -402,7 +399,7 @@ static bool read_close_session(JCR *jcr)
       return false;
    }
    /* Send final statistics to File daemon */
-   bnet_fsend(fd, OK_close);
+   bnet_fsend(fd, OK_close, jcr->JobStatus);
    Dmsg1(160, ">filed: %s\n", fd->msg);
 
    bnet_sig(fd, BNET_EOD);          /* send EOD to File daemon */