diff options
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3112,9 +3112,12 @@ static int #include <winerror.h> cygwin_flock(int fd, int op) { + int old_errno = errno; int ret = flock(fd, op); - if (GetLastError() == ERROR_NOT_LOCKED) + if (GetLastError() == ERROR_NOT_LOCKED) { ret = 0; + errno = old_errno; + } return ret; } # define flock(fd, op) cygwin_flock(fd, op) |