/* Forward referenced functions */
void terminate_stored(int sig);
static void check_config();
-static void *device_allocation(void *arg);
+
+extern "C" void *device_allocation(void *arg);
#define CONFIG_FILE "bacula-sd.conf" /* Default config file */
/* Single server used for Director and File daemon */
bnet_thread_server(me->SDaddr, me->SDport, me->max_concurrent_jobs * 2 + 1,
- &dird_workq, connection_request);
+ &dird_workq, handle_connection_request);
exit(1); /* to keep compiler quiet */
}
* We are started as a separate thread. The
* resources are alread locked.
*/
-static void *device_allocation(void *arg)
+extern "C"
+void *device_allocation(void *arg)
{
DEVRES *device;
JCR *jcr;
DCR *dcr;
jcr = new_jcr(sizeof(JCR), stored_free_jcr);
+ jcr->JobType = JT_SYSTEM;
+ /* Initialize FD start condition variable */
+ int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
+ if (errstat != 0) {
+ Jmsg1(jcr, M_ABORT, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat));
+ }
jcr->device = device;
dcr = new_dcr(jcr, device->dev);
- switch (read_dev_volume_label(jcr, device->dev, dcr->block)) {
+ switch (read_dev_volume_label(dcr, dcr->block)) {
case VOL_OK:
break;
default: