]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/stored.c
Fix bscan walk DCRs + add some bools to dev.c
[bacula/bacula] / bacula / src / stored / stored.c
index 865d6bb511aba893ceb53a139be867ccf7ae4538..957738336fb02483cd4b80d8cb9a2031098582fb 100644 (file)
@@ -38,7 +38,8 @@
 /* Forward referenced functions */
 void terminate_stored(int sig);
 static void check_config();
-static void *device_allocation(void *arg);
+
+extern "C" void *device_allocation(void *arg);
 
 #define CONFIG_FILE "bacula-sd.conf"  /* Default config file */
 
@@ -94,7 +95,7 @@ int main (int argc, char *argv[])
 
    init_stack_dump();
    my_name_is(argc, argv, "bacula-sd");
-   textdomain("bacula-sd");
+   textdomain("bacula");
    init_msg(NULL, NULL);
    daemon_start_time = time(NULL);
 
@@ -227,7 +228,7 @@ int main (int argc, char *argv[])
                                 
    /* Single server used for Director and File daemon */
    bnet_thread_server(me->SDaddr, me->SDport, me->max_concurrent_jobs * 2 + 1,
-                     &dird_workq, connection_request);
+                     &dird_workq, handle_connection_request);
    exit(1);                          /* to keep compiler quiet */
 }
 
@@ -295,7 +296,8 @@ static void check_config()
  * We are started as a separate thread.  The
  *  resources are alread locked.
  */
-static void *device_allocation(void *arg)
+extern "C"
+void *device_allocation(void *arg)
 {
    DEVRES *device;
 
@@ -322,9 +324,15 @@ static void *device_allocation(void *arg)
         JCR *jcr;
         DCR *dcr;
         jcr = new_jcr(sizeof(JCR), stored_free_jcr);
+        jcr->JobType = JT_SYSTEM;
+        /* Initialize FD start condition variable */
+        int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
+        if (errstat != 0) {
+            Jmsg1(jcr, M_ABORT, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat));
+        }
         jcr->device = device;
         dcr = new_dcr(jcr, device->dev);
-        switch (read_dev_volume_label(jcr, device->dev, dcr->block)) {
+        switch (read_dev_volume_label(dcr, dcr->block)) {
            case VOL_OK:
               break;
            default:
@@ -405,6 +413,6 @@ void terminate_stored(int sig)
    stop_watchdog();
    close_memory_pool();
 
-   sm_dump(False);                   /* dump orphaned buffers */
+   sm_dump(false);                   /* dump orphaned buffers */
    exit(sig);
 }