     /* TODO : check if it is used somewhere */
     if (jcr->job->RunScripts == NULL) {
        Dmsg0(200, "Warning, job->RunScripts is empty\n");
-@@ -450,15 +456,20 @@
+@@ -493,15 +499,20 @@
        }
  
        /* check MaxWaitTime */

    POOLMEM *stime;                    /* start time for incremental/differential */
Index: src/lib/jcr.c
===================================================================
--- src/lib/jcr.c	(rvision 4696)
+++ src/lib/jcr.c	(copie de travail)
@@ -546,18 +546,54 @@
 
 void set_jcr_job_status(JCR *jcr, int JobStatus)
 {
+   bool set_waittime=false;
+   Dmsg2(800, "set_jcr_job_status(%s, %c)\n", jcr->Job, JobStatus);
+   /* if wait state is new, we keep current time for watchdog MaxWaitTime */
+   switch (JobStatus) {
+      case JS_WaitFD:
+      case JS_WaitSD:
+      case JS_WaitMedia:
+      case JS_WaitMount:
+      case JS_WaitStoreRes:
+      case JS_WaitJobRes:
+      case JS_WaitClientRes:
+      case JS_WaitMaxJobs:
+      case JS_WaitPriority:
+	 set_waittime = true;
+      default:
+	 break;
+   }
+
+   switch (jcr->JobStatus) {
    /*
     * For a set of errors, ... keep the current status
     *   so it isn't lost. For all others, set it.
     */
-   switch (jcr->JobStatus) {
    case JS_ErrorTerminated:
    case JS_Error:
    case JS_FatalError:
    case JS_Differences:
    case JS_Canceled:
       break;
+   /*
+    * For a set of Wait situation, keep old time.
+    */

          }
Index: src/dird/job.c
===================================================================
--- src/dird/job.c	(revision 6731)
+++ src/dird/job.c	(working copy)
@@ -41,8 +41,9 @@
 static void *job_thread(void *arg);
 static void job_monitor_watchdog(watchdog_t *self);
