summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-06 07:13:53 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-06 07:13:53 +0000
commit9e58e4a5e71d0afab3e3b7ed531a927ef36e4c58 (patch)
treea83715430a8d1b8b4dbeef96ecb905641a7f2d69 /file.c
parent1e34639d386e217e49e05cef91b81f749d79d4c6 (diff)
* file.c (cygwin_flock): save old errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/file.c b/file.c
index 176e2e57e2..b470bd9ab8 100644
--- a/file.c
+++ b/file.c
@@ -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)