SuSE.
For 1.33
+- Implement .consolerc for Console
- I want to restore by file to some date.
- Implement fast block rejection.
- Is it really important to make Job name the same to find the
if (dev->state & ST_TAPE && dev_cap(dev, CAP_BSR)) {
/* Now back up over what we wrote and read the last block */
- if (bsf_dev(dev, 1) != 0 || bsf_dev(dev, 1) != 0) {
+ if (!bsf_dev(dev, 1) || !bsf_dev(dev, 1)) {
ok = false;
Jmsg(jcr, M_ERROR, 0, _("Backspace file at EOT failed. ERR=%s\n"), strerror(dev->dev_errno));
}
/* Backspace over record */
- if (ok && bsr_dev(dev, 1) != 0) {
+ if (ok && !bsr_dev(dev, 1)) {
ok = false;
Jmsg(jcr, M_ERROR, 0, _("Backspace record at EOT failed. ERR=%s\n"), strerror(dev->dev_errno));
/*
/* Attempt to reposition to re-read the block */
if (dev->state & ST_TAPE) {
Dmsg0(100, "Backspace record for reread.\n");
- if (bsr_dev(dev, 1) != 0) {
- Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+ if (!bsr_dev(dev, 1)) {
+ Jmsg(jcr, M_ERROR, 0, "%s", strerror_dev(dev));
block->read_len = 0;
return 0;
}
static void eomcmd()
{
if (!eod_dev(dev)) {
- Pmsg1(0, _("Bad status from MTEOD. ERR=%s\n"), strerror_dev(dev));
+ Pmsg1(0, "%s", strerror_dev(dev));
return;
} else {
Pmsg0(0, _("Moved to end of medium.\n"));
*/
static void bsfcmd()
{
- int stat;
- if ((stat=bsf_dev(dev, 1)) < 0) {
- Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror(errno));
+ if (!bsf_dev(dev, 1)) {
+ Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror_dev(dev));
} else {
Pmsg0(0, _("Backspaced one file.\n"));
}
*/
static void bsrcmd()
{
- int stat;
-
- if ((stat=bsr_dev(dev, 1)) < 0) {
- Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror(errno));
+ if (!bsr_dev(dev, 1)) {
+ Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror_dev(dev));
} else {
Pmsg0(0, _("Backspaced one record.\n"));
}
}
weofcmd();
weofcmd();
- if (bsf_dev(dev, 1) != 0) {
- Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno));
+ if (!bsf_dev(dev, 1)) {
+ Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev));
goto bail_out;
}
- if (bsf_dev(dev, 1) != 0) {
- Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno));
+ if (!bsf_dev(dev, 1)) {
+ Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev));
goto bail_out;
}
Pmsg0(0, "Backspaced over two EOFs OK.\n");
- if (bsr_dev(dev, 1) != 0) {
- Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror(dev->dev_errno));
+ if (!bsr_dev(dev, 1)) {
+ Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror_dev(dev));
goto bail_out;
}
Pmsg0(0, "Backspace record OK.\n");
dev->state |= ST_EOT;
return 1;
}
+ dev->dev_errno = errno;
+ Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
+ dev->dev_name, strerror(dev->dev_errno));
return 0;
}
#ifdef MTEOM
* the second EOF.
*/
if (dev_cap(dev, CAP_BSFATEOM)) {
- stat = (bsf_dev(dev, 1) == 0);
+ stat = bsf_dev(dev, 1);
dev->file++; /* keep same file */
} else {
update_pos_dev(dev); /* update position */
if (dev->fd < 0) {
dev->dev_errno = EBADF;
- Mmsg0(&dev->errmsg, _("Bad call to bsf_dev. Archive not open\n"));
+ Mmsg0(&dev->errmsg, _("Bad call to bsf_dev. Archive device not open\n"));
Emsg0(M_FATAL, 0, dev->errmsg);
return 0;
}
if (!(dev_state(dev, ST_TAPE))) {
+ Mmsg1(&dev->errmsg, _("Device %s cannot BSF because it is not a tape.\n"),
+ dev->dev_name);
return 0;
}
Dmsg0(29, "bsf_dev\n");
if (dev->fd < 0) {
dev->dev_errno = EBADF;
- Mmsg0(&dev->errmsg, _("Bad call to weof_dev. Archive not open\n"));
+ Mmsg0(&dev->errmsg, _("Bad call to weof_dev. Archive drive not open\n"));
Emsg0(M_FATAL, 0, dev->errmsg);
return -1;
}
dev->file_addr = 0;
} else {
clrerror_dev(dev, MTWEOF);
- Mmsg2(&dev->errmsg, _("ioctl MTWEOF error on %s. ERR=%s.\n"),
- dev->dev_name, strerror(dev->dev_errno));
+ if (stat == -1) {
+ Mmsg2(&dev->errmsg, _("ioctl MTWEOF error on %s. ERR=%s.\n"),
+ dev->dev_name, strerror(dev->dev_errno));
+ }
}
return stat;
}
}
}
Dmsg2(100, "New block at position=(file:block) %d:%d\n", dev->file, dev->block_num);
+#define FAST_BLOCK_REJECTION
#ifdef FAST_BLOCK_REJECTION
/* this does not stop when file/block are too big */
if (!match_bsr_block(jcr->bsr, block)) {
/* */
-#undef VERSION
+#undef VERSION
#define VERSION "1.32b"
#define VSTRING "1"
-#define BDATE "08 Oct 2003"
-#define LSMDATE "08Oct03"
+#define BDATE "09 Oct 2003"
+#define LSMDATE "09Oct03"
/* Debug flags */
-#undef DEBUG
+#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK