]> git.sur5r.net Git - bacula/bacula/commitdiff
Add binary mode to open
authorKern Sibbald <kern@sibbald.com>
Tue, 24 Feb 2004 16:49:35 +0000 (16:49 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 24 Feb 2004 16:49:35 +0000 (16:49 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1084 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.cpp

index 0254d0c731ea2dd8b5d2163cded1781bb9185e8f..c474e16df37300b105cabc78f7f22c152742c4d5 100644 (file)
@@ -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);
 
 }