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

subversion at fluffy.co.uk subversion at fluffy.co.uk
Mon Sep 4 00:51:22 BST 2006


Author: chris
Date: 2006-09-04 00:51:22 +0100 (Mon, 04 Sep 2006)
New Revision: 954

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

Pass requested open flags to OpenFileByNameUtf8


Modified: box/chris/merge/lib/win32/emu.cpp
===================================================================
--- box/chris/merge/lib/win32/emu.cpp	2006-09-03 23:48:34 UTC (rev 953)
+++ box/chris/merge/lib/win32/emu.cpp	2006-09-03 23:51:22 UTC (rev 954)
@@ -681,9 +681,10 @@
 //		Created: 10th December 2004
 //
 // --------------------------------------------------------------------------
-HANDLE OpenFileByNameUtf8(const char* pFileName)
+HANDLE OpenFileByNameUtf8(const char* pFileName, DWORD flags)
 {
-	std::string AbsPathWithUnicode = ConvertPathToAbsoluteUnicode(pFileName);
+	std::string AbsPathWithUnicode = 
+		ConvertPathToAbsoluteUnicode(pFileName);
 	
 	if (AbsPathWithUnicode.size() == 0)
 	{
@@ -701,7 +702,7 @@
 	}
 
 	HANDLE handle = CreateFileW(pBuffer, 
-		FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA, 
+		flags,
 		FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, 
 		NULL, 
 		OPEN_EXISTING, 
@@ -757,13 +758,9 @@
 // --------------------------------------------------------------------------
 int emu_stat(const char * pName, struct stat * st)
 {
-	// at the mo
-	st->st_uid = 0;
-	st->st_gid = 0;
-	st->st_nlink = 1;
+	HANDLE handle = OpenFileByNameUtf8(pName, 
+		FILE_READ_ATTRIBUTES | FILE_READ_EA);
 
-	HANDLE handle = OpenFileByNameUtf8(pName);
-
 	if (handle == NULL)
 	{
 		// errno already set and error logged by OpenFileByNameUtf8()
@@ -795,7 +792,8 @@
 // --------------------------------------------------------------------------
 int statfs(const char * pName, struct statfs * s)
 {
-	HANDLE handle = OpenFileByNameUtf8(pName);
+	HANDLE handle = OpenFileByNameUtf8(pName,
+		FILE_READ_ATTRIBUTES | FILE_READ_EA);
 
 	if (handle == NULL)
 	{




More information about the Boxbackup-commit mailing list