-/*
- * Job control and execution for Storage Daemon
- *
- * Kern Sibbald, MM
- *
- * Version $Id$
- *
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Job control and execution for Storage Daemon
+ *
+ * Kern Sibbald, MM
+ *
+ * Version $Id$
+ *
+ */
#include "bacula.h"
#include "stored.h"
struct timespec timeout;
int errstat;
+ Dsm_check(1);
Dmsg1(200, "Run_cmd: %s\n", jcr->dir_bsock->msg);
/* The following jobs don't need the FD */
switch (jcr->JobType) {
gettimeofday(&tv, &tz);
timeout.tv_nsec = tv.tv_usec * 1000;
- timeout.tv_sec = tv.tv_sec + 30 * 60; /* wait 30 minutes */
+ timeout.tv_sec = tv.tv_sec + me->client_wait;
- Dmsg1(100, "%s waiting on FD to contact SD\n", jcr->Job);
+ Dmsg2(100, "%s waiting %d sec for FD to contact SD\n",
+ jcr->Job, (int)me->client_wait);
/*
* Wait for the File daemon to contact us to start the Job,
* when he does, we will be released, unless the 30 minutes
}
jcr->file_bsock = fd;
- jcr->file_bsock->jcr = jcr;
+ jcr->file_bsock->set_jcr(jcr);
Dmsg1(110, "Found Job %s\n", job_name);
}
jcr->dcrs = NULL;
+ /* Avoid a double free */
+ if (jcr->dcr == jcr->read_dcr) {
+ jcr->read_dcr = NULL;
+ }
if (jcr->dcr) {
free_dcr(jcr->dcr);
jcr->dcr = NULL;
delete jcr->write_store;
jcr->write_store = NULL;
}
+ Dsm_check(1);
return;
}