[Box Backup-commit] COMMIT r951 - box/chris/merge/lib/win32

subversion at fluffy.co.uk subversion at fluffy.co.uk
Mon Sep 4 00:41:31 BST 2006


Author: chris
Date: 2006-09-04 00:41:31 +0100 (Mon, 04 Sep 2006)
New Revision: 951

Modified:
   box/chris/merge/lib/win32/emu.cpp
Log:
(refs #3)

Improved handling of UNIX flags to openfile(), allows multiple opens


Modified: box/chris/merge/lib/win32/emu.cpp
===================================================================
--- box/chris/merge/lib/win32/emu.cpp	2006-09-03 23:39:08 UTC (rev 950)
+++ box/chris/merge/lib/win32/emu.cpp	2006-09-03 23:41:31 UTC (rev 951)
@@ -518,19 +518,19 @@
 
 	if (flags & O_WRONLY)
 	{
+		accessRights = FILE_WRITE_DATA;
 		shareMode = FILE_SHARE_WRITE;
 	}
-	if (flags & O_RDWR)
+	else if (flags & (O_RDWR | O_CREAT))
 	{
-		shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+		accessRights |= FILE_WRITE_ATTRIBUTES 
+			| FILE_WRITE_DATA | FILE_WRITE_EA;
+		shareMode |= FILE_SHARE_WRITE;
 	}
+
 	if (flags & O_CREAT)
 	{
 		createDisposition = OPEN_ALWAYS;
-		shareMode |= FILE_SHARE_WRITE;
-		accessRights |= FILE_WRITE_ATTRIBUTES 
-			| FILE_WRITE_DATA | FILE_WRITE_EA 
-			| FILE_ALL_ACCESS;
 	}
 	if (flags & O_TRUNC)
 	{




More information about the Boxbackup-commit mailing list