Revert "Use the FILE_SHARE_DELETE flag for CreateFile on a mapping"

This reverts commit 884a0e269c.

I'm reverting this because it doesn't actually make the problem go
away.  It appears that instead we need to do unmap-then-replace.
This commit is contained in:
Nick Mathewson 2013-06-12 10:45:48 -04:00
parent 3bdc4e5fee
commit fff9386af8
2 changed files with 1 additions and 8 deletions

View File

@ -1,7 +0,0 @@
o Major bugfixes (windows):
- Open files to be mapped with FILE_SHARE_DELETE so that we can
replace them before closing the mapping. This is a likely cause of
warnings and crashes when replacing the microdescriptor cache
file. Diagnosed based on comments by "doorss" and by Robert
Ransom. Possible fix for bug 2077; bugfix on 0.2.2.6-alpha.

View File

@ -248,7 +248,7 @@ tor_mmap_file(const char *filename)
strlcpy(tfilename,filename,MAX_PATH);
#endif
file_handle = CreateFile(tfilename,
GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
GENERIC_READ, FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,