]> git.sur5r.net Git - bacula/bacula/commitdiff
Add win32 directory
authorKern Sibbald <kern@sibbald.com>
Tue, 10 Feb 2004 13:47:35 +0000 (13:47 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 10 Feb 2004 13:47:35 +0000 (13:47 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1036 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/dev.c

index 146be7862441b6f1b5ef4389f31b23f83333e435..d004f023d09e34a552aab7cbfbd849556cac05aa 100644 (file)
@@ -429,9 +429,28 @@ eod_dev(DEVICE *dev)
       return 0;
    }
 #ifdef MTEOM
+
+   if (dev_cap(dev, CAP_FASTFSF) && !dev_cap(dev, CAP_EOM)) {
+      struct mtget mt_stat;
+      Dmsg0(200,"PAPED using FAST FSF for EOM\n");
+      if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno <= 0) {
+       if (!rewind_dev(dev)) {
+         return 0;
+       }
+      }
+      mt_com.mt_op = MTFSF;
+      mt_com.mt_count = INT32_MAX;    /* use big positive number */
+      if (mt_com.mt_count < 0) {
+        mt_com.mt_count = INT16_MAX; /* brain damaged system */
+      }
+   }
+
    if (dev_cap(dev, CAP_EOM)) {
+      Dmsg0(200,"PAPED using EOM for EOM\n");
       mt_com.mt_op = MTEOM;
       mt_com.mt_count = 1;
+   }
+   if(dev_cap(dev, CAP_FASTFSF) || dev_cap(dev, CAP_EOM)) {
       if ((stat=ioctl(dev->fd, MTIOCTOP, (char *)&mt_com)) < 0) {
          Dmsg1(50, "ioctl error: %s\n", strerror(dev->dev_errno));
         clrerror_dev(dev, mt_com.mt_op);
@@ -440,6 +459,7 @@ eod_dev(DEVICE *dev)
            dev->dev_name, strerror(dev->dev_errno));
         return 0;
       }
+
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
         dev->dev_errno = errno;
          Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"),