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 */
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) {
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);
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);