From 42e692ddf0eab4d9d3c1055da17a858d9a2a38d4 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 10 Feb 2004 13:47:35 +0000 Subject: [PATCH] Add win32 directory git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1036 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/dev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 146be78624..d004f023d0 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -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"), -- 2.39.5