From: Kern Sibbald Date: Tue, 8 May 2007 19:28:22 +0000 (+0000) Subject: Keep correct errno when FSF fails X-Git-Tag: Release-7.0.0~6399 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=225546018b76820eec2005e861c7908d0cec9642;p=bacula%2Fbacula Keep correct errno when FSF fails git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4732 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 34e7d225fe..eb1cd41c97 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -1294,10 +1294,15 @@ bool DEVICE::fsf(int num) * forward space past the end of the medium. */ if (has_cap(CAP_FSF) && has_cap(CAP_MTIOCGET) && has_cap(CAP_FASTFSF)) { + int errno_save; mt_com.mt_op = MTFSF; mt_com.mt_count = num; stat = tape_ioctl(m_fd, MTIOCTOP, (char *)&mt_com); + errno_save = errno; if (stat < 0 || (os_file=get_os_tape_file()) < 0) { + if (os_file >= 0) { /* get_os_tape_file reset errno */ + errno = errno_save; + } berrno be; set_eot(); Dmsg0(200, "Set ST_EOT\n");