This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
flock() on Windows should set proper errno numbers.
authorJan Dubois <jand@activestate.com>
Fri, 13 Nov 2009 02:38:08 +0000 (18:38 -0800)
committerJan Dubois <jand@activestate.com>
Fri, 13 Nov 2009 02:38:08 +0000 (18:38 -0800)
commit97b33cac18e30b878b151b5f3fcbf9c32cb7b037
tree661f5c3f198bdf2bc1caa1a2b10ec1b4f8e91745
parentfd9e8b45c89ee5d36539a3655dae7737fb78c21e
flock() on Windows should set proper errno numbers.

It used to set errno to GetLastError(), which is from an
incompatible set of error codes.  That doesn't make any
sense, especially since the GetLastError() value is also
available at the Perl level via $^E.

It is important for autodie.pm that flock() will set
$! to WSAWOULDBLOCK when GetLastError() returns
ERROR_LOCK_VIOLATION because that is the value POSIX.pm
now returns for POSIX::EWOULDBLOCK.
win32/win32.c