From eef35e68e23340ff0aa8e29de25f93856447749c Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 6 Feb 2006 07:13:53 +0000 Subject: * file.c (cygwin_flock): save old errno. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 176e2e57e..b470bd9ab 100644 --- a/file.c +++ b/file.c @@ -3112,9 +3112,12 @@ static int #include 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) -- cgit