From 92ae5b1206bcf58c94bc4de08921b7553e41d708 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 20 May 2003 19:43:32 +0000 Subject: [PATCH] Add MTIOCERRSTAT for FreeBSD git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@524 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/dev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index b0edad2711..98eada35dc 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -1016,16 +1016,26 @@ clrerror_dev(DEVICE *dev, int func) Emsg0(M_ERROR, 0, dev->errmsg); } } +/* Found on Linux */ #ifdef MTIOCLRERR { struct mtop mt_com; - int stat; mt_com.mt_op = MTIOCLRERR; mt_com.mt_count = 1; - stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); + /* Clear any error condition on the tape */ + ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); Dmsg0(200, "Did MTIOCLRERR\n"); } #endif + +/* Typically on FreeBSD */ +#ifdef MTIOCERRSTAT +{ + /* Read and clear SCSI error status */ + union mterrstat mt_errstat; + ioctl(dev->fd, MTIOCERRSTAT, (char *)&mt_errstat); +} +#endif } /* -- 2.39.5