]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/stored.c
Move reservations message lock to lock jcr only this
[bacula/bacula] / bacula / src / stored / stored.c
index e027ffd89d49e9ddfb5c741afd74d5f294db5444..996f4fc358956d80e0708a4f7d0b0f2ffe6dca85 100644 (file)
@@ -7,8 +7,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
@@ -483,7 +483,7 @@ void *device_initialization(void *arg)
          continue;
       }
 
-      jcr->dcr = dcr = new_dcr(jcr, dev);
+      jcr->dcr = dcr = new_dcr(jcr, NULL, dev);
       if (dev->is_autochanger()) {
          /* If autochanger set slot in dev sturcture */
          get_autochanger_loaded_slot(dcr);
@@ -537,6 +537,7 @@ void terminate_stored(int sig)
       exit(1);
    }
    in_here = true;
+   stop_watchdog();
 
    if (sig == SIGTERM) {              /* normal shutdown request? */
       /*
@@ -554,7 +555,7 @@ void terminate_stored(int sig)
          set_jcr_job_status(jcr, JS_Canceled);
          fd = jcr->file_bsock;
          if (fd) {
-            fd->timed_out = true;
+            fd->set_timed_out();
             Dmsg1(100, "term_stored killing JobId=%d\n", jcr->JobId);
             pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
             /* ***FIXME*** wiffle through all dcrs */
@@ -601,7 +602,6 @@ void terminate_stored(int sig)
    }
    term_reservations_lock();
    term_msg();
-   stop_watchdog();
    cleanup_crypto();
    free_volume_list();
    close_memory_pool();