]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Backport Enterprise src/findlib
authorKern Sibbald <kern@sibbald.com>
Sat, 14 Jul 2018 09:50:16 +0000 (11:50 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 14 Jul 2018 09:50:16 +0000 (11:50 +0200)
bacula/src/findlib/attribs.c
bacula/src/findlib/bfile.c
bacula/src/findlib/namedpipe.c

index abd971997dd63a7ae25000b763933c970c0a81f2..10242233025626ef4c31cf7966e20aea031ace20 100644 (file)
@@ -979,8 +979,8 @@ void win_error(JCR *jcr, const char *prefix, DWORD lerror)
    strip_trailing_junk(msg);
    if (jcr) {
       Jmsg2(jcr, M_ERROR, 0, _("Error in %s: ERR=%s\n"), prefix, msg);
-      MessageBox(NULL, msg, prefix, MB_OK);
    }
+   MessageBox(NULL, msg, prefix, MB_OK);
    LocalFree(msg);
 }
 #endif /* HAVE_WIN32 */
index 5b2bbab1ebd91e28332085452e5abb4a916e8b78..fa6f9b931e7f786e8967fe7aefb8e74e41ec1d6a 100644 (file)
@@ -1014,7 +1014,7 @@ int bopen(BFILE *bfd, const char *fname, uint64_t flags, mode_t mode)
    Dmsg1(dbglvl, "open file %s\n", fname);
 
    /* We use fnctl to set O_NOATIME if requested to avoid open error */
-   bfd->fid = open(fname, flags & ~O_NOATIME, mode);
+   bfd->fid = open(fname, (flags | O_CLOEXEC) & ~O_NOATIME, mode);
 
    /* Set O_NOATIME if possible */
    if (bfd->fid != -1 && flags & O_NOATIME) {
index 92b25589e533f8cf8959211e039d22204df53fe1..fbfa2d0727534aedc8e421718cd1cdfceb68baf5 100644 (file)
@@ -266,7 +266,7 @@ int main(int argc, char **argv)
          exit(4);
       }
 
-      fp = fopen(argv[3], "rb");
+      fp = bfopen(argv[3], "rb");
       if (!fp) {
          printf("Unable to open %s for reading\n", argv[3]);
          exit(4);
@@ -305,7 +305,7 @@ int main(int argc, char **argv)
       printf("buf=[%s]\n", buf);
 
       snprintf(file, sizeof(file), "%s.out", argv[3]);
-      fp = fopen(file, "wb");
+      fp = bfopen(file, "wb");
       if (!fp) {
          printf("Unable to open %s for writing\n", buf);
          exit(4);