From: Kern Sibbald Date: Tue, 24 Feb 2004 16:49:35 +0000 (+0000) Subject: Add binary mode to open X-Git-Tag: Release-1.34.0~95 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=80fabd824d06e77d40380c371f3a27ed3199ac63;p=bacula%2Fbacula Add binary mode to open git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1084 91ce42f0-d328-0410-95d8-f526ca767f89 --- 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); }