Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License
+ version 2 as amended with additional clauses defined in the
+ file LICENSE in the main source directory.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
*/
if (!read_block_from_device(dcr, CHECK_BLOCK_NUMBERS)) {
if (dev->at_eot()) {
DEV_RECORD *trec = new_record();
- Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
+ Jmsg(jcr, M_INFO, 0, _("End of Volume at file %u on device %s, Volume \"%s\"\n"),
dev->file, dev->print_name(), dcr->VolumeName);
if (!mount_cb(dcr)) {
- Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
+ Jmsg(jcr, M_INFO, 0, _("End of all volumes.\n"));
ok = false; /* Stop everything */
/*
* Create EOT Label so that Media record may
} else if (dev->at_eof()) {
if (verbose) {
- Jmsg(jcr, M_INFO, 0, "Got EOF at file %u on device %s, Volume \"%s\"\n",
+ Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
dev->file, dev->print_name(), dcr->VolumeName);
}
Dmsg3(200, "Got EOF at file %u on device %s, Volume \"%s\"\n",
dev->file, dev->print_name(), dcr->VolumeName);
continue;
- } else if (dev_state(dev, ST_SHORT)) {
+ } else if (dev->is_short_block()) {
Jmsg1(jcr, M_ERROR, 0, "%s", dev->errmsg);
continue;
} else {
display_tape_error_status(jcr, dev);
if (forge_on || jcr->ignore_label_errors) {
dev->fsr(1); /* try skipping bad record */
- Pmsg0(000, "Did fsr\n");
+ Pmsg0(000, _("Did fsr\n"));
continue; /* try to continue */
}
ok = false; /* stop everything */
record = 0;
rec->state = 0;
Dmsg1(300, "Block empty %d\n", is_block_empty(rec));
- for (rec->state=0; !is_block_empty(rec); ) {
+ for (rec->state=0; ok && !is_block_empty(rec); ) {
if (!read_record_from_block(block, rec)) {
Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
block->BlockNumber, rec->remainder);
continue; /* we don't want record, read next one */
}
}
+ dcr->VolLastIndex = rec->FileIndex; /* let caller know where we are */
if (is_partial_record(rec)) {
Dmsg6(300, "Partial, break. recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
rec_state_to_str(rec), block->BlockNumber,
break; /* read second part of record */
}
ok = record_cb(dcr, rec);
- if (rec->Stream == STREAM_MD5_SIGNATURE || rec->Stream == STREAM_SHA1_SIGNATURE) {
+ if (crypto_digest_stream_type(rec->Stream) != CRYPTO_DIGEST_NONE) {
Dmsg3(300, "Done FI=%u before set_eof pos %u:%u\n", rec->FileIndex,
dev->file, dev->block_num);
if (match_set_eof(jcr->bsr, rec) && try_repositioning(jcr, rec, dev)) {
if (!dev->at_eot()) {
/* Set EOT flag to force mount of next Volume */
jcr->mount_next_volume = true;
- dev->state |= ST_EOT;
+ dev->set_eot();
}
rec->Block = 0;
return true;
}
if (bsr) {
if (verbose) {
- Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %u:%u to %u:%u\n",
+ Jmsg(jcr, M_INFO, 0, _("Reposition from (file:block) %u:%u to %u:%u\n"),
dev->file, dev->block_num, bsr->volfile->sfile,
bsr->volblock->sblock);
}
memset(sessrec, 0, sizeof(sessrec));
switch (rec->FileIndex) {
case PRE_LABEL:
- rtype = "Fresh Volume Label";
+ rtype = _("Fresh Volume Label");
break;
case VOL_LABEL:
- rtype = "Volume Label";
+ rtype = _("Volume Label");
unser_volume_label(dev, rec);
break;
case SOS_LABEL:
- rtype = "Begin Session";
+ rtype = _("Begin Session");
unser_session_label(sessrec, rec);
break;
case EOS_LABEL:
- rtype = "End Session";
+ rtype = _("End Session");
break;
case EOM_LABEL:
- rtype = "End of Media";
+ rtype = _("End of Media");
break;
default:
- bsnprintf(buf, sizeof(buf), "Unknown code %d\n", rec->FileIndex);
+ bsnprintf(buf, sizeof(buf), _("Unknown code %d\n"), rec->FileIndex);
rtype = buf;
break;
}
- Dmsg5(300, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
+ Dmsg5(300, _("%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n"),
rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
}