From 225546018b76820eec2005e861c7908d0cec9642 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 8 May 2007 19:28:22 +0000 Subject: [PATCH] Keep correct errno when FSF fails git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4732 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/dev.c | 5 +++++ 1 file changed, 5 insertions(+) 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"); -- 2.39.5