]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/job.c
Make cd accept wildcards
[bacula/bacula] / bacula / src / stored / job.c
index c2d925965ffd0e2c7bc80b8ffda214fd4cddb1ae..8be2b4e201eea18ce761c1cad355019b6f9dc5af 100644 (file)
@@ -67,14 +67,14 @@ static char BAD_job[]   = "3915 Bad Job command. stat=%d CMD: %s\n";
  */
 bool job_cmd(JCR *jcr)
 {
-   int JobId;
+   int32_t JobId;
    char auth_key[100];
    char spool_size[30];
    char seed[100];
    BSOCK *dir = jcr->dir_bsock;
    POOL_MEM job_name, client_name, job, fileset_name, fileset_md5;
-   int JobType, level, spool_attributes, no_attributes, spool_data;
-   int write_part_after_job, PreferMountedVols;
+   int32_t JobType, level, spool_attributes, no_attributes, spool_data;
+   int32_t write_part_after_job, PreferMountedVols;
    int stat;
    JCR *ojcr;
 
@@ -152,7 +152,9 @@ bool job_cmd(JCR *jcr)
    Dmsg2(50, ">dird jid=%u: %s", (uint32_t)jcr->JobId, dir->msg);
    jcr->sd_auth_key = bstrdup(auth_key);
    memset(auth_key, 0, sizeof(auth_key));
+   new_plugins(jcr);            /* instantiate the plugins */
    generate_daemon_event(jcr, "JobStart");
+   generate_plugin_event(jcr, bsdEventJobStart, (void *)"JobStart");
    return true;
 }
 
@@ -163,7 +165,7 @@ bool run_cmd(JCR *jcr)
    struct timespec timeout;
    int errstat = 0;
 
-   Dsm_check(1);
+   Dsm_check(200);
    Dmsg1(200, "Run_cmd: %s\n", jcr->dir_bsock->msg);
 
    /* If we do not need the FD, we are doing a migrate, copy, or virtual
@@ -174,8 +176,7 @@ bool run_cmd(JCR *jcr)
       return false;
    }
 
-   jcr->setJobStatus(JS_WaitFD);          /* wait for FD to connect */
-   dir_send_job_status(jcr);
+   jcr->sendJobStatus(JS_WaitFD);          /* wait for FD to connect */
 
    gettimeofday(&tv, &tz);
    timeout.tv_nsec = tv.tv_usec * 1000;
@@ -422,7 +423,7 @@ void stored_free_jcr(JCR *jcr)
       delete jcr->write_store;
       jcr->write_store = NULL;
    }
-   Dsm_check(1);
+   Dsm_check(200);
 
    if (jcr->JobId != 0)
       write_state_file(me->working_directory, "bacula-sd", get_first_port_host_order(me->sdaddrs));