summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
132c0c3)
Handle M_RDWR properly
Allow multiple concurrent readers
#ifdef WIN32
int flags = 0;
#ifdef WIN32
int flags = 0;
int create_flags = OPEN_EXISTING;
if(mode&M_READ)
flags |= GENERIC_READ;
int create_flags = OPEN_EXISTING;
if(mode&M_READ)
flags |= GENERIC_READ;
{
flags |= GENERIC_WRITE;
{
flags |= GENERIC_WRITE;
case C_NEW: create_flags = CREATE_NEW; break;
}
}
case C_NEW: create_flags = CREATE_NEW; break;
}
}
+ else
+ share_flags = FILE_SHARE_READ;
- *handle = CreateFile(fn.c_str(), flags, 0, 0, create_flags, FILE_ATTRIBUTE_NORMAL, 0);
+ *handle = CreateFile(fn.c_str(), flags, share_flags, 0, create_flags, FILE_ATTRIBUTE_NORMAL, 0);
if(!handle)
{
int err = GetLastError();
if(!handle)
{
int err = GetLastError();