BlockCheckSum = bcrc32((uint8_t *)b->buf+BLKHDR_CS_LENGTH,
block_len-BLKHDR_CS_LENGTH);
- Pmsg6(000, "Dump block %s %x: size=%d BlkNum=%d\n"
-" Hdrcksum=%x cksum=%x\n",
+ Pmsg6(000, _("Dump block %s %x: size=%d BlkNum=%d\n"
+" Hdrcksum=%x cksum=%x\n"),
msg, b, block_len, BlockNumber, CheckSum, BlockCheckSum);
p = b->buf + bhl;
while (p < (b->buf + block_len+WRITE_RECHDR_LENGTH)) {
unser_int32(FileIndex);
unser_int32(Stream);
unser_uint32(data_len);
- Pmsg6(000, " Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n",
+ Pmsg6(000, _(" Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n"),
VolSessionId, VolSessionTime, FI_to_ascii(FileIndex),
stream_to_ascii(Stream, FileIndex), data_len, p);
p += data_len + rhl;
#ifdef DEBUG_BLOCK_ZEROING
uint32_t *bp = (uint32_t *)block->buf;
if (bp[0] == 0 && bp[1] == 0 && bp[2] == 0 && block->buf[12] == 0) {
- Jmsg0(jcr, M_ABORT, 0, "Write block header zeroed.\n");
+ Jmsg0(jcr, M_ABORT, 0, _("Write block header zeroed.\n"));
}
#endif
#ifdef DEBUG_BLOCK_ZEROING
if (bp[0] == 0 && bp[1] == 0 && bp[2] == 0 && block->buf[12] == 0) {
- Jmsg0(jcr, M_ABORT, 0, "Write block header zeroed.\n");
+ Jmsg0(jcr, M_ABORT, 0, _("Write block header zeroed.\n"));
}
#endif
dcr->EndBlock = dev->EndBlock;
dcr->EndFile = dev->EndFile;
} else {
- /* Save address of start of block just written */
- dcr->EndBlock = (uint32_t)dev->file_addr;
- dcr->EndFile = (uint32_t)(dev->file_addr >> 32);
+ /* Save address of block just written */
+ uint64_t addr = dev->file_addr + wlen - 1;
+ dcr->EndBlock = (uint32_t)addr;
+ dcr->EndFile = (uint32_t)(addr >> 32);
+ dev->block_num = dcr->EndBlock;
+ dev->file = dcr->EndFile;
}
if (dcr->VolFirstIndex == 0 && block->FirstIndex > 0) {
dcr->VolFirstIndex = block->FirstIndex;
dcr->block->write_failed = true;
if (weof_dev(dev, 1) != 0) { /* end the tape */
dev->VolCatInfo.VolCatErrors++;
- Jmsg(dcr->jcr, M_ERROR, 0, "Error writing final EOF to tape. This tape may not be readable.\n"
- "%s", dev->errmsg);
+ Jmsg(dcr->jcr, M_ERROR, 0, _("Error writing final EOF to tape. This tape may not be readable.\n"
+ "%s"), dev->errmsg);
ok = false;
Dmsg0(100, "WEOF error.\n");
}
dcr->EndBlock = dev->EndBlock;
dcr->EndFile = dev->EndFile;
} else {
- dcr->EndBlock = (uint32_t)dev->file_addr;
- dcr->EndFile = (uint32_t)(dev->file_addr >> 32);
+ uint64_t addr = dev->file_addr + block->read_len - 1;
+ dcr->EndBlock = (uint32_t)addr;
+ dcr->EndFile = (uint32_t)(addr >> 32);
dev->block_num = dcr->EndBlock;
dev->file = dcr->EndFile;
}
- dev->file_addr += block->block_len;
- dev->file_size += block->block_len;
+ dev->file_addr += block->read_len;
+ dev->file_size += block->read_len;
/*
* If we read a short block on disk,