From 80fabd824d06e77d40380c371f3a27ed3199ac63 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 24 Feb 2004 16:49:35 +0000 Subject: [PATCH] Add binary mode to open git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1084 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/compat/compat.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 0254d0c731..c474e16df3 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -1093,19 +1093,19 @@ utime(const char *fname, struct utimbuf *times) cvt_utime_to_ftime(times->modtime, mod); HANDLE h = CreateFile(tmpbuf, - FILE_WRITE_ATTRIBUTES, - FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - 0, - NULL); + FILE_WRITE_ATTRIBUTES, + FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + 0, + NULL); if (h == INVALID_HANDLE_VALUE) { const char *err = errorString(); d_msg(__FILE__, __LINE__, 99, "Cannot open file for stat (%s):%s\n", tmpbuf, err); LocalFree((void *)err); - return -1; + return -1; } int rval = SetFileTime(h, NULL, &acc, &mod) ? 0 : -1; @@ -1120,7 +1120,7 @@ utime(const char *fname, struct utimbuf *times) int open(const char *file, int flags, int mode) { - return _open(file, flags, mode); + return _open(file, flags, mode|_O_BINARY); } -- 2.39.5