From: Eric Bollengier Date: Wed, 29 Oct 2008 15:16:13 +0000 (+0000) Subject: ebl Be sure that wait_time is set before using it X-Git-Tag: Release-3.0.0~668 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7fec674e5f44bf4137aa97143ff868efd6931e57;p=bacula%2Fbacula ebl Be sure that wait_time is set before using it git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7942 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/fix_maxwaittime.patch b/bacula/patches/testing/fix_maxwaittime.patch index 502364d547..dcc9593453 100644 --- a/bacula/patches/testing/fix_maxwaittime.patch +++ b/bacula/patches/testing/fix_maxwaittime.patch @@ -1,20 +1,25 @@ Index: src/dird/job.c =================================================================== ---- src/dird/job.c (révision 7929) -+++ src/dird/job.c (copie de travail) -@@ -551,7 +551,7 @@ +--- src/dird/job.c (revision 7939) ++++ src/dird/job.c (working copy) +@@ -549,9 +549,10 @@ + if (!job_waiting(jcr)) { + return false; } - Dmsg3(200, "check maxwaittime %u - %u >= %u\n", watchdog_time, jcr->wait_time, job->MaxWaitTime); - if (job->MaxWaitTime != 0 && +- Dmsg3(200, "check maxwaittime %u - %u >= %u\n", watchdog_time, jcr->wait_time, job->MaxWaitTime); +- if (job->MaxWaitTime != 0 && - (watchdog_time - jcr->wait_time) >= job->MaxWaitTime) { ++ Dmsg3(200, "check maxwaittime %u - %u >= %u\n", ++ (watchdog_time - jcr->wait_time), jcr->wait_time, job->MaxWaitTime); ++ if (job->MaxWaitTime != 0 && jcr->wait_time != 0 && + (watchdog_time - jcr->wait_time + jcr->wait_time_sum) >= job->MaxWaitTime) { cancel = true; } Index: src/jcr.h =================================================================== ---- src/jcr.h (révision 7929) -+++ src/jcr.h (copie de travail) +--- src/jcr.h (revision 7939) ++++ src/jcr.h (working copy) @@ -216,7 +216,8 @@ time_t start_time; /* when job actually started */ time_t run_time; /* used for computing speed */ @@ -27,8 +32,8 @@ Index: src/jcr.h POOLMEM *stime; /* start time for incremental/differential */ Index: src/lib/jcr.c =================================================================== ---- src/lib/jcr.c (révision 7929) -+++ src/lib/jcr.c (copie de travail) +--- src/lib/jcr.c (revision 7939) ++++ src/lib/jcr.c (working copy) @@ -738,41 +738,29 @@ return priority; } @@ -96,7 +101,7 @@ Index: src/lib/jcr.c case JS_WaitMaxJobs: case JS_WaitPriority: - set_waittime = false; /* keep old time */ -+ if (!enter_in_waittime) { ++ if (!enter_in_waittime) { /* we get out the wait time */ + jcr->wait_time_sum += (time(NULL) - jcr->wait_time); + jcr->wait_time = 0; + } @@ -116,7 +121,7 @@ Index: src/lib/jcr.c +void set_jcr_job_status(JCR *jcr, int JobStatus) +{ + int priority, old_priority; -+ ++ int oldJobStatus = jcr->JobStatus; + priority = get_status_priority(JobStatus); + old_priority = get_status_priority(oldJobStatus); +