]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/stored/vtape_dev.c
authorEric Bollengier <eric@baculasystems.com>
Tue, 12 May 2020 19:24:48 +0000 (21:24 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:18 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Norbert Bizet <norbert.bizet@baculasystems.com>
Date:   Tue Mar 14 17:29:19 2017 +0100

    Fix vtape_dev when USE_VTAPE is not defined.

bacula/src/stored/vtape_dev.c

index 5c71810ce533f63d145aca2a43e8ec0730870cbb..644b86a754031ab199cac4eb827f91e4d047b0a0 100644 (file)
@@ -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 */