<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,7 @@ use Carp;
 use strict;
 use warnings;
 use Tie::RefHash;   # To cache subroutine refs
+use Config;
 
 use constant PERL510     =&gt; ( $] &gt;= 5.010 );
 
@@ -52,6 +53,10 @@ our %_EWOULDBLOCK = (
     MSWin32 =&gt; 33,
 );
 
+# the linux parisc port has separate EAGAIN and EWOULDBLOCK,
+# and the kernel returns EAGAIN
+my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0;
+
 # We have some tags that can be passed in for use with import.
 # These are all assumed to be CORE::
 
@@ -732,6 +737,11 @@ sub _one_invocation {
         my $EWOULDBLOCK = eval { POSIX::EWOULDBLOCK(); }
                           || $_EWOULDBLOCK{$^O}
                           || _autocroak(&quot;Internal error - can't overload flock - EWOULDBLOCK not defined on this system.&quot;);
+        my $EAGAIN = $EWOULDBLOCK;
+        if ($try_EAGAIN) {
+            $EAGAIN = eval { POSIX::EAGAIN(); }
+                          || _autocroak(&quot;Internal error - can't overload flock - EAGAIN not defined on this system.&quot;);
+        }
 
         require Fcntl;      # For Fcntl::LOCK_NB
 
@@ -747,7 +757,9 @@ sub _one_invocation {
             # If we failed, but we're using LOCK_NB and
             # returned EWOULDBLOCK, it's not a real error.
 
-            if (\$_[1] &amp; Fcntl::LOCK_NB() and \$! == $EWOULDBLOCK ) {
+            if (\$_[1] &amp; Fcntl::LOCK_NB() and
+                (\$! == $EWOULDBLOCK or
+                ($try_EAGAIN and \$! == $EAGAIN ))) {
                 return \$retval;
             }
 </diff>
      <filename>lib/Fatal.pm</filename>
    </modified>
    <modified>
      <diff>@@ -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 =&gt; &quot;EWOULDBLOCK not defined on this system&quot;;
 
+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, &quot;Double-flocking should be EWOULDBLOCK&quot;);
+if (!$try_EAGAIN) {
+    is($!+0, $EWOULDBLOCK, &quot;Double-flocking should be EWOULDBLOCK&quot;);
+} else {
+    ok($!+0 == $EWOULDBLOCK || $!+0 == $EAGAIN, &quot;Double-flocking should be EWOULDBLOCK or EAGAIN&quot;);
+}
 ok(!$return, &quot;flocking a file twice should fail&quot;);
 is($@, &quot;&quot;, &quot;Non-blocking flock should not fail on EWOULDBLOCK&quot;);
 </diff>
      <filename>t/flock.t</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d8a7b2423d411f4646cd2836f22c88af826ee538</id>
    </parent>
  </parents>
  <author>
    <name>Niko Tyni</name>
    <email>ntyni@debian.org</email>
  </author>
  <url>http://github.com/pfenwick/autodie/commit/037738e11a6097734b0e1dabdd77b92e5fe35219</url>
  <id>037738e11a6097734b0e1dabdd77b92e5fe35219</id>
  <committed-date>2009-09-03T14:02:09-07:00</committed-date>
  <authored-date>2009-08-30T03:58:35-07:00</authored-date>
  <message>Allow for flock returning EAGAIN instead of EWOULDBLOCK on linux/parisc

Contrary to the documentation, flock(2) returns EAGAIN instead of
EWOULDBLOCK on the Linux parisc port (aka. hppa).

http://bugs.debian.org/543731</message>
  <tree>3c17f654158e9feed8690270079078e44a9cafcd</tree>
  <committer>
    <name>Paul Fenwick</name>
    <email>pjf@perltraining.com.au</email>
  </committer>
</commit>
