]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply reschedule patch to 1.37 code.
authorKern Sibbald <kern@sibbald.com>
Tue, 22 Mar 2005 10:45:58 +0000 (10:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 22 Mar 2005 10:45:58 +0000 (10:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1896 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird.h
bacula/src/dird/job.c
bacula/src/dird/jobq.c

index fe00fffb0c30c0e72aebecfb94806b97563fc559..2dbcd73d1fb94471458b30b1ee7898953d0c2e61 100644 (file)
@@ -45,3 +45,4 @@ extern int SDConnectTimeout;
 
 /* From job.c */
 void dird_free_jcr(JCR *jcr);
+void dird_free_jcr_pointers(JCR *jcr);
index 7544b6feffcbc2698e698fbd9981480d8635be5b..ef9a1d7c58bd99b68b7277d1a6cc1d036969e49c 100644 (file)
@@ -740,15 +740,9 @@ void create_unique_job_name(JCR *jcr, const char *base_name)
    }
 }
 
-/*
- * Free the Job Control Record if no one is still using it.
- *  Called from main free_jcr() routine in src/lib/jcr.c so
- *  that we can do our Director specific cleanup of the jcr.
- */
-void dird_free_jcr(JCR *jcr)
+/* Called directly from job rescheduling */
+void dird_free_jcr_pointers(JCR *jcr)
 {
-   Dmsg0(200, "Start dird free_jcr\n");
-
    if (jcr->sd_auth_key) {
       free(jcr->sd_auth_key);
       jcr->sd_auth_key = NULL;
@@ -787,7 +781,21 @@ void dird_free_jcr(JCR *jcr)
    }
    if (jcr->term_wait_inited) {
       pthread_cond_destroy(&jcr->term_wait);
+      jcr->term_wait_inited = false;
    }
+}
+
+/*
+ * Free the Job Control Record if no one is still using it.
+ *  Called from main free_jcr() routine in src/lib/jcr.c so
+ *  that we can do our Director specific cleanup of the jcr.
+ */
+void dird_free_jcr(JCR *jcr)
+{
+   Dmsg0(200, "Start dird free_jcr\n");
+
+   dird_free_jcr_pointers(jcr);
+
    /* Delete lists setup to hold storage pointers */
    if (jcr->storage) {
       delete jcr->storage;
index 0bf994bce00121d03b27b802f41998f0d5e8d9cb..984fea3238afa926f05d5ff275994145ec87d1d7 100755 (executable)
@@ -482,7 +482,7 @@ void *jobq_server(void *arg)
            bstrftime(dt, sizeof(dt), time(NULL));
             Jmsg(jcr, M_INFO, 0, _("Rescheduled Job %s at %s to re-run in %d seconds.\n"),
               jcr->Job, dt, (int)jcr->job->RescheduleInterval);
-           dird_free_jcr(jcr);          /* partial cleanup old stuff */
+           dird_free_jcr_pointers(jcr);     /* partial cleanup old stuff */
            jcr->JobStatus = JS_WaitStartTime;
            jcr->SDJobStatus = 0;
            if (jcr->JobBytes == 0) {