Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4:Update
perl.import5740
perl-autodie-flock.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-autodie-flock.diff of Package perl.import5740
diff --git a/cpan/autodie/t/flock.t b/cpan/autodie/t/flock.t index a7550ba..6421a56 100755 --- cpan/autodie/t/flock.t +++ cpan/autodie/t/flock.t @@ -2,7 +2,8 @@ use strict; use Test::More; use Fcntl qw(:flock); -use POSIX qw(EWOULDBLOCK); +use POSIX qw(EWOULDBLOCK EAGAIN); +use Config; require Fatal; @@ -10,6 +11,9 @@ my $EWOULDBLOCK = eval { EWOULDBLOCK() } || $Fatal::_EWOULDBLOCK{$^O} || plan skip_all => "EWOULDBLOCK not defined on this system"; +my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0; +my $EAGAIN = eval { EAGAIN() }; + my ($self_fh, $self_fh2); eval { @@ -55,7 +59,11 @@ eval { $return = flock($self_fh2, LOCK_EX | LOCK_NB); }; -is($!+0, $EWOULDBLOCK, "Double-flocking should be EWOULDBLOCK"); +if (!$try_EAGAIN) { + is($!+0, $EWOULDBLOCK, "Double-flocking should be EWOULDBLOCK"); +} else { + ok($!+0 == $EWOULDBLOCK || $!+0 == $EAGAIN, "Double-flocking should be EWOULDBLOCK or EAGAIN"); +} ok(!$return, "flocking a file twice should fail"); is($@, "", "Non-blocking flock should not fail on EWOULDBLOCK");
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor