dev->rLock(false);
Dmsg1(200, "Opening device %s\n", dcr->VolumeName);
if (!dev->open(dcr, OPEN_READ_WRITE)) {
- Emsg1(M_FATAL, 0, _("dev open failed: %s\n"), dev->errmsg);
+ Emsg1(M_FATAL, 0, _("dev open failed: %s\n"), dev->print_errmsg());
ok = false;
goto bail_out;
}
Pmsg1(0, _("I/O error on device: ERR=%s"), dev->bstrerror());
break;
case VOL_TYPE_ERROR:
- Pmsg1(0, _("Volume type error: ERR=%s\n"), dev->errmsg);
+ Pmsg1(0, _("Volume type error: ERR=%s\n"), dev->print_errmsg());
break;
case VOL_NAME_ERROR:
Pmsg0(0, _("Volume name error\n"));
}
Pmsg0(0, _("Backspace record OK.\n"));
if (!dcr->read_block_from_dev(NO_BLOCK_NUMBER_CHECK)) {
- berrno be;
- Pmsg1(0, _("Read block failed! ERR=%s\n"), be.bstrerror(dev->dev_errno));
+ Pmsg1(0, _("Read block failed! ERR=%s\n"), dev->print_errmsg());
goto bail_out;
}
memset(rec->data, 0, rec->data_len);
for (i=1; i<=2*num_recs; i++) {
read_again:
if (!dcr->read_block_from_dev(NO_BLOCK_NUMBER_CHECK)) {
- berrno be;
if (dev_state(dev, ST_EOF)) {
Pmsg0(-1, _("Got EOF on tape.\n"));
if (i == num_recs+1) {
goto read_again;
}
}
- Pmsg2(0, _("Read block %d failed! ERR=%s\n"), i, be.bstrerror(dev->dev_errno));
+ Pmsg2(0, _("Read block %d failed! ERR=%s\n"), i, dev->print_errmsg());
goto bail_out;
}
memset(rec->data, 0, rec->data_len);
}
read_again:
if (!dcr->read_block_from_dev(NO_BLOCK_NUMBER_CHECK)) {
- berrno be;
if (dev_state(dev, ST_EOF)) {
Pmsg0(-1, _("Got EOF on tape.\n"));
if (!got_eof) {
}
}
Pmsg4(0, _("Read block %d failed! file=%d blk=%d. ERR=%s\n\n"),
- recno, file, blk, be.bstrerror(dev->dev_errno));
+ recno, file, blk, dev->print_errmsg());
Pmsg0(0, _("This may be because the tape drive block size is not\n"
" set to variable blocking as normally used by Bacula.\n"
" Please see the Tape Testing chapter in the manual and \n"
printf(_("Short block read.\n"));
continue;
}
- printf(_("Error reading block. ERR=%s\n"), dev->bstrerror());
+ printf(_("Error reading block. ERR=%s\n"), dev->print_errmsg());
goto bail_out;
}
if (block->block_len != block_size) {
dev->close();
dev->num_writers = 0;
if (!acquire_device_for_read(dcr)) {
- Pmsg1(-1, "%s", dev->errmsg);
+ Pmsg1(-1, "%s", dev->print_errmsg());
goto bail_out;
}
/*
}
Pmsg1(-1, _("Reading block %u.\n"), last_block_num);
if (!dcr->read_block_from_device(NO_BLOCK_NUMBER_CHECK)) {
- Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror());
+ Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->print_errmsg());
goto bail_out;
}
if (compare_blocks(last_block, block)) {
dev->clear_read();
if (!acquire_device_for_read(dcr)) {
- Pmsg1(-1, "%s", dev->errmsg);
+ Pmsg1(-1, "%s", dev->print_errmsg());
goto bail_out;
}
}
Pmsg1(-1, _("Reading block %d.\n"), dev->block_num);
if (!dcr->read_block_from_device(NO_BLOCK_NUMBER_CHECK)) {
- Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror());
+ Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->print_errmsg());
goto bail_out;
}
if (compare_blocks(first_block, block)) {
}
Pmsg1(-1, _("Reading block %d.\n"), dev->block_num);
if (!dcr->read_block_from_device(NO_BLOCK_NUMBER_CHECK)) {
- Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror());
+ Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->print_errmsg());
goto bail_out;
}
if (compare_blocks(last_block, block)) {
if (dcr->VolumeName[0] == 0) {
return dir_ask_sysop_to_create_appendable_volume(dcr);
}
- Pmsg1(-1, "%s", dev->errmsg); /* print reason */
+ Pmsg1(-1, "%s", dev->print_errmsg()); /* print reason */
if (dcr->VolumeName[0] == 0 || strcmp(dcr->VolumeName, "TestVolume2") == 0) {
fprintf(stderr, _("Mount second Volume on device %s and press return when ready: "),
dev->print_name());