Skip Menu |

This queue is for tickets about the FileHandle-Fmode CPAN distribution.

Report information
The Basics
Id: 80607
Status: open
Priority: 0/
Queue: FileHandle-Fmode

People
Owner: Nobody in particular
Requestors: Xavier (no email address)
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.12
Fixed in: (no value)



Subject: FileHandle::Fmode fails to build on Debian GNU/Hurd due to Hurd including O_RDONLY in O_RDWR
Hi, on Debian, we have to patch FileHandle::Fmode to build it on Debian GNU/Hurd Attached is a patch that may works on all platforms.
Subject: fmode_perl_hurd.patch
--- 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; }
On Sun Nov 04 01:46:55 2012, GUIMARD wrote: Show quoted text
> Hi, > > on Debian, we have to patch FileHandle::Fmode to build it on Debian
GNU/Hurd Show quoted text
> > Attached is a patch that may works on all platforms.
Seems ok to me - works fine on my old mdk-9.1 linux box, and on my Windows builds of perl (which range from 5.6 through to 5.16). Many thanks for the patch ! I'll upload a new version to CPAN in the next day or so. (And I'll let you know when that's done.) Cheers, Rob
Subject: Re: [rt.cpan.org #80607] FileHandle::Fmode fails to build on Debian GNU/Hurd due to Hurd including O_RDONLY in O_RDWR
Date: Sun, 04 Nov 2012 15:28:14 +0100
To: bug-FileHandle-Fmode [...] rt.cpan.org
From: Xavier Guimard <x.guimard [...] free.fr>
Le 04/11/2012 09:19, Sisyphus via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80607 > > > On Sun Nov 04 01:46:55 2012, GUIMARD wrote:
>> Hi, >> >> on Debian, we have to patch FileHandle::Fmode to build it on Debian
> GNU/Hurd
>> >> Attached is a patch that may works on all platforms.
> > Seems ok to me - works fine on my old mdk-9.1 linux box, and on my > Windows builds of perl (which range from 5.6 through to 5.16). > > Many thanks for the patch ! > I'll upload a new version to CPAN in the next day or so. (And I'll let > you know when that's done.) > > Cheers, > Rob
Thanks, I'll wait to upload new version in Debian. Regards, Xavier
On Sun Nov 04 09:28:41 2012, x.guimard@free.fr wrote: Show quoted text
> Thanks, I'll wait to upload new version in Debian.
Uploaded a few minutes ago. As you're probably well aware, it might not be immediately accessible - though I can already see it listed on backpan: http://backpan.perl.org/authors/id/S/SI/SISYPHUS/FileHandle-Fmode-0.13.tar.gz. Cheers, Rob