From: Eric Bollengier Date: Tue, 12 May 2020 19:24:48 +0000 (+0200) Subject: BEE Backport bacula/src/stored/vtape_dev.c X-Git-Tag: Release-11.3.2~1610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7008ff98ad9ecc794ffb89907291680e676cbc6;p=thirdparty%2Fbacula.git BEE Backport bacula/src/stored/vtape_dev.c This commit is the result of the squash of the following main commits: Author: Norbert Bizet Date: Tue Mar 14 17:29:19 2017 +0100 Fix vtape_dev when USE_VTAPE is not defined. --- diff --git a/bacula/src/stored/vtape_dev.c b/bacula/src/stored/vtape_dev.c index 5c71810ce5..644b86a754 100644 --- a/bacula/src/stored/vtape_dev.c +++ b/bacula/src/stored/vtape_dev.c @@ -910,7 +910,7 @@ int vtape::d_open(const char *pathname, int uflags) Dmsg1(dbglevel, "Can't stat on %s\n", pathname); if (uflags & O_NONBLOCK) { online = false; - fd = ::open("/dev/null", O_RDWR | O_LARGEFILE, 0600); + fd = ::open("/dev/null", O_RDWR | O_LARGEFILE | O_CLOEXEC, 0600); } } else { fd = ::open(pathname, O_RDWR | O_LARGEFILE | O_CLOEXEC, 0600); @@ -927,7 +927,7 @@ int vtape::d_open(const char *pathname, int uflags) strcpy(lockfile, pathname); strcat(lockfile, ".l"); - lockfd = ::open(lockfile, O_CREAT | O_RDWR | O_LARGEFILE | O_CLOEXEC, 0600); + lockfd = ::open(lockfile, O_CREAT | O_RDWR | O_LARGEFILE, 0600); if (lockfd < 0) { berrno be; Dmsg2(0, "Unable to open vtape device lock %s ERR=%s\n", lockfile, be.bstrerror()); @@ -1011,4 +1011,4 @@ const char *vtape::print_type() return "Vtape"; } -#endif /* ! USE_VTAPE */ +#endif /* !USE_VTAPE */