diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-02-06 07:13:53 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-02-06 07:13:53 +0000 |
commit | b29ad4cd95d4f56f60f1099caebfc92fb1019891 (patch) | |
tree | 1306d0e1b2422b56086b858b21de2e64114d8c0b | |
parent | 895778951ed1f79da411453e6eb93e9592730a35 (diff) |
* file.c (cygwin_flock): save old errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | file.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3047,9 +3047,12 @@ rb_file_truncate(VALUE obj, VALUE len) static int 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) |