From: Kern Sibbald Date: Tue, 22 Mar 2005 10:45:58 +0000 (+0000) Subject: Apply reschedule patch to 1.37 code. X-Git-Tag: Release-7.0.0~8914 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b3a34e14f73ee4118c034c983f098fe42036ff60;p=bacula%2Fbacula Apply reschedule patch to 1.37 code. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1896 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dird.h b/bacula/src/dird/dird.h index fe00fffb0c..2dbcd73d1f 100644 --- a/bacula/src/dird/dird.h +++ b/bacula/src/dird/dird.h @@ -45,3 +45,4 @@ extern int SDConnectTimeout; /* From job.c */ void dird_free_jcr(JCR *jcr); +void dird_free_jcr_pointers(JCR *jcr); diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 7544b6feff..ef9a1d7c58 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -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; diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index 0bf994bce0..984fea3238 100755 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -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) {