Bug#681028: libfilehandle-fmode-perl: FTBFS on Debian GNU/Hurd
Barry deFreese
bdefreese at debian.org
Tue Jul 10 02:38:40 UTC 2012
Package: libfilehandle-fmode-perl
Version: 0.11-1
Severity: important
User: debian-hurd at lists.debian.org
Usertags: hurd
Tags: patch
Hi,
Currently libfilehandle-fmode-perl fails to build on Debian GNU/Hurd due to Hurd including O_RDONLY
in O_RDWR, etc.
Attached is a patch for building on Hurd. I have also tested the patch on GNU/Linux on i386. I
haven't tested it on other archs/OSs.
Thank you,
Barry deFreese
-------------- next part --------------
--- libfilehandle-fmode-perl-0.11.orig/Fmode.pm
+++ libfilehandle-fmode-perl-0.11/Fmode.pm
@@ -1,5 +1,5 @@
package FileHandle::Fmode;
-use Fcntl qw(O_WRONLY O_RDWR O_APPEND F_GETFL);
+use Fcntl qw(O_ACCMODE O_RDONLY O_WRONLY O_RDWR O_APPEND F_GETFL);
use strict;
require Exporter;
@@ -45,7 +45,7 @@
return 0;
}
my $fmode = fcntl($_[0], F_GETFL, my $slush = 0);
- if(defined($fmode) && !($fmode & O_WRONLY) && !($fmode & O_RDWR)) {return 1}
+ if(defined($fmode) && ($fmode & O_ACCMODE) == O_RDONLY) {return 1}
return 0;
}
@@ -61,7 +61,7 @@
return 0;
}
my $fmode = fcntl($_[0], F_GETFL, my $slush = 0);
- if($fmode & O_WRONLY) {return 1}
+ if(defined($fmode) && ($fmode & O_ACCMODE) == O_WRONLY) {return 1}
return 0;
}
@@ -87,7 +87,7 @@
return 0;
}
my $fmode = fcntl($_[0], F_GETFL, my $slush = 0);
- if($fmode & O_RDWR) {return 1}
+ if(defined($fmode) && ($fmode & O_ACCMODE) == O_RDWR) {return 1}
return 0;
}
More information about the pkg-perl-maintainers
mailing list