(ef_open) [_WIN32]: Fix to get a read lock instead of a write lock for

EFF_RDONLY and to get a write lock instead of a total file lock for
file opened for writing.
This commit is contained in:
Ron Koenderink 2006-11-29 12:16:43 +00:00
parent a3b52a748c
commit ce63991c9f

View file

@ -91,7 +91,7 @@ ef_open(int type, int how)
#if defined(_WIN32) #if defined(_WIN32)
oflags |= O_BINARY; oflags |= O_BINARY;
if ((fd = sopen(ep->file, oflags, if ((fd = sopen(ep->file, oflags,
how & EFF_RDONLY ? SH_DENYWR : SH_DENYRW, how & EFF_RDONLY ? SH_DENYNO : SH_DENYWR,
0660)) < 0) { 0660)) < 0) {
logerror("Can't open %s (%s)", ep->file, strerror(errno)); logerror("Can't open %s (%s)", ep->file, strerror(errno));
return 0; return 0;