The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
Dmsg1(000, "<filed: %s", bs->msg);
Emsg1(M_ERROR, 0, _("Invalid connection. Len=%d\n"), bs->msglen);
bs->close();
Dmsg1(000, "<filed: %s", bs->msg);
Emsg1(M_ERROR, 0, _("Invalid connection. Len=%d\n"), bs->msglen);
bs->close();
/* Initialize FD start condition variable */
int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
if (errstat != 0) {
/* Initialize FD start condition variable */
int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
if (errstat != 0) {
- Jmsg1(jcr, M_FATAL, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat));
+ berrno be;
+ Jmsg1(jcr, M_FATAL, 0, _("Unable to init job cond variable: ERR=%s\n"), be.bstrerror(errstat));
Dmsg1(10, "setdebug_cmd: %s", dir->msg);
if (sscanf(dir->msg, "setdebug=%d trace=%d", &level, &trace_flag) != 2 || level < 0) {
Dmsg1(10, "setdebug_cmd: %s", dir->msg);
if (sscanf(dir->msg, "setdebug=%d trace=%d", &level, &trace_flag) != 2 || level < 0) {
if (sscanf(dir->msg, "cancel Job=%127s", Job) == 1) {
if (!(jcr=get_jcr_by_full_name(Job))) {
if (sscanf(dir->msg, "cancel Job=%127s", Job) == 1) {
if (!(jcr=get_jcr_by_full_name(Job))) {
} else {
oldStatus = jcr->JobStatus;
set_jcr_job_status(jcr, JS_Canceled);
} else {
oldStatus = jcr->JobStatus;
set_jcr_job_status(jcr, JS_Canceled);
pthread_cond_broadcast(&wait_device_release);
}
Jmsg(jcr, M_INFO, 0, _("Job %s marked to be canceled.\n"), jcr->Job);
pthread_cond_broadcast(&wait_device_release);
}
Jmsg(jcr, M_INFO, 0, _("Job %s marked to be canceled.\n"), jcr->Job);
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
/* Set old volume name for open if relabeling */
bstrncpy(dcr->VolCatInfo.VolCatName, volname, sizeof(dcr->VolCatInfo.VolCatName));
if (dev->open(dcr, mode) < 0) {
/* Set old volume name for open if relabeling */
bstrncpy(dcr->VolCatInfo.VolCatName, volname, sizeof(dcr->VolCatInfo.VolCatName));
if (dev->open(dcr, mode) < 0) {
- bnet_fsend(dir, _("3910 Unable to open device %s: ERR=%s\n"),
- dev->print_name(), dev->strerror());
+ dir->fsend(_("3910 Unable to open device %s: ERR=%s\n"),
+ dev->print_name(), dev->bstrerror());
/* Relabel request. If oldname matches, continue */
if (strcmp(oldname, dev->VolHdr.VolumeName) != 0) {
/* Relabel request. If oldname matches, continue */
if (strcmp(oldname, dev->VolHdr.VolumeName) != 0) {
case VOL_NO_LABEL:
if (!write_new_volume_label_to_dev(dcr, newname, poolname,
relabel, true /* write dvd now */)) {
case VOL_NO_LABEL:
if (!write_new_volume_label_to_dev(dcr, newname, poolname,
relabel, true /* write dvd now */)) {
break;
}
bstrncpy(dcr->VolumeName, newname, sizeof(dcr->VolumeName));
/* The following 3000 OK label. string is scanned in ua_label.c */
break;
}
bstrncpy(dcr->VolumeName, newname, sizeof(dcr->VolumeName));
/* The following 3000 OK label. string is scanned in ua_label.c */
edit_uint64(dev->VolCatInfo.VolCatBytes, ed1),
dev->is_dvd()?1:0, newname, dev->print_name());
break;
case VOL_NO_MEDIA:
edit_uint64(dev->VolCatInfo.VolCatBytes, ed1),
dev->is_dvd()?1:0, newname, dev->print_name());
break;
case VOL_NO_MEDIA:
/* Someone is waiting, wake him */
Dmsg0(100, "Waiting for mount. Attempting to wake thread\n");
dev->set_blocked(BST_MOUNT);
/* Someone is waiting, wake him */
Dmsg0(100, "Waiting for mount. Attempting to wake thread\n");
dev->set_blocked(BST_MOUNT);
dev->print_name());
pthread_cond_broadcast(&dev->wait_next_vol);
Dmsg1(100, "JobId=%u broadcast wait_device_release\n", (uint32_t)dcr->jcr->JobId);
dev->print_name());
pthread_cond_broadcast(&dev->wait_next_vol);
Dmsg1(100, "JobId=%u broadcast wait_device_release\n", (uint32_t)dcr->jcr->JobId);
}
/* We freed the device, so reopen it and wake any waiting threads */
if (dev->open(dcr, OPEN_READ_ONLY) < 0) {
}
/* We freed the device, so reopen it and wake any waiting threads */
if (dev->open(dcr, OPEN_READ_ONLY) < 0) {
dev->bstrerror());
if (dev->blocked() == BST_UNMOUNTED) {
/* We blocked the device, so unblock it */
dev->bstrerror());
if (dev->blocked() == BST_UNMOUNTED) {
/* We blocked the device, so unblock it */
"If this is not a blank tape, try unmounting and remounting the Volume.\n"),
dev->print_name());
}
} else if (dev->is_tape()) {
if (dev->open(dcr, OPEN_READ_ONLY) < 0) {
"If this is not a blank tape, try unmounting and remounting the Volume.\n"),
dev->print_name());
}
} else if (dev->is_tape()) {
if (dev->open(dcr, OPEN_READ_ONLY) < 0) {
"If this is not a blank tape, try unmounting and remounting the Volume.\n"),
dev->print_name());
}
} else if (dev->is_unmountable()) {
if (dev->mount(1)) {
"If this is not a blank tape, try unmounting and remounting the Volume.\n"),
dev->print_name());
}
} else if (dev->is_unmountable()) {
if (dev->mount(1)) {
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
unload_autochanger(dcr, -1);
}
Dmsg0(90, "Device already released\n");
unload_autochanger(dcr, -1);
}
Dmsg0(90, "Device already released\n");
dev->print_name());
} else if (dev->blocked() == BST_WAITING_FOR_SYSOP) {
Dmsg2(90, "%d waiter dev_block=%d.\n", dev->num_waiting,
dev->blocked());
unload_autochanger(dcr, -1);
dev->print_name());
} else if (dev->blocked() == BST_WAITING_FOR_SYSOP) {
Dmsg2(90, "%d waiter dev_block=%d.\n", dev->num_waiting,
dev->blocked());
unload_autochanger(dcr, -1);
dev->print_name());
} else if (dev->blocked() == BST_UNMOUNTED_WAITING_FOR_SYSOP) {
Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
dev->blocked());
dev->print_name());
} else if (dev->blocked() == BST_UNMOUNTED_WAITING_FOR_SYSOP) {
Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
dev->blocked());
} else { /* device not being used */
Dmsg0(90, "Device not in use, releaseing\n");
unload_autochanger(dcr, -1);
} else { /* device not being used */
Dmsg0(90, "Device not in use, releaseing\n");
unload_autochanger(dcr, -1);
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
}
} else {
/* NB dir->msg gets clobbered in bnet_fsend, so save command */
pm_strcpy(jcr->errmsg, dir->msg);
dev->print_name());
/* Under certain "safe" conditions, we can steal the lock */
} else if (safe_cmd || !dev->is_open() || dev->can_steal_lock()) {
dev->print_name());
/* Under certain "safe" conditions, we can steal the lock */
} else if (safe_cmd || !dev->is_open() || dev->can_steal_lock()) {
}
} else { /* error on scanf */
pm_strcpy(jcr->errmsg, dir->msg);
}
} else { /* error on scanf */
pm_strcpy(jcr->errmsg, dir->msg);
switch (read_dev_volume_label(dcr)) {
case VOL_OK:
/* DO NOT add quotes around the Volume name. It is scanned in the DIR */
switch (read_dev_volume_label(dcr)) {
case VOL_OK:
/* DO NOT add quotes around the Volume name. It is scanned in the DIR */
- bnet_fsend(dir, _("3001 Volume=%s Slot=%d\n"), dev->VolHdr.VolumeName, Slot);
+ dir->fsend(_("3001 Volume=%s Slot=%d\n"), dev->VolHdr.VolumeName, Slot);