extern BSOCK *filed_chan;
extern int r_first, r_last;
extern struct s_res resources[];
-extern char my_name[];
-extern time_t daemon_start_time;
extern struct s_last_job last_job;
extern bool init_done;
DEVICE *dev = dcr->dev;
int label_status;
int mode;
+ const char *volname = (relabel == 0) ? newname : oldname;
steal_device_lock(dev, &hold, BST_WRITING_LABEL);
Dmsg1(100, "Stole device %s lock, writing label.\n", dev->print_name());
dcr->VolCatInfo.VolCatParts=1;
}
- if (!try_autoload_device(dcr->jcr, slot, (relabel == 0) ? newname : oldname)) {
+ if (!try_autoload_device(dcr->jcr, slot, volname)) {
goto bail_out; /* error */
}
} else {
mode = CREATE_READ_WRITE;
}
+ if (dev->is_dvd()) {
+ 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());