From: Kern Sibbald Date: Tue, 20 May 2003 19:43:32 +0000 (+0000) Subject: Add MTIOCERRSTAT for FreeBSD X-Git-Tag: Release-1.31~132 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=92ae5b1206bcf58c94bc4de08921b7553e41d708;p=bacula%2Fbacula Add MTIOCERRSTAT for FreeBSD git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@524 91ce42f0-d328-0410-95d8-f526ca767f89 --- 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 } /*