diff options
author | Pino Toscano <pino@debian.org> | 2011-10-31 21:37:04 +0000 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2012-08-09 16:04:11 -0400 |
commit | 3a0aaea7bf1b7839074362f176cf34b30f313a19 (patch) | |
tree | 0c7986a95032828296de3ab7c506efbc915e156f | |
parent | e15fdbc5407d0db6fd61546e55babb7210202362 (diff) | |
download | perl-3a0aaea7bf1b7839074362f176cf34b30f313a19.tar.gz |
Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
while compiling perl 5.14.2 on GNU/Hurd, I ran into what it seems a
undefined POSIX behaviour in ext/POSIX/t/sysconf.t.
my $fd = POSIX::open($fifo, O_RDWR)
or skip("could not open $fifo ($!)", 3 * @path_consts_fifo);
according to the POSIX open()[1] about O_RDWR,
The result is undefined if this flag is applied to a FIFO.
.... which is actually our case.
Apparently Linux and *FreeBSD (and maybe also OSes) accept this
behaviour, but on GNU/Hurd this causes the open() call to block
undefinitely. Given there's nothing done with the FIFO if not querying
{,f}pathconf() values, the proposed solution I attached is to change
the opening mode to "O_RDONLY | O_NONBLOCK".
[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
-rw-r--r-- | ext/POSIX/t/sysconf.t | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t index 2dc9762977..4a03217e9d 100644 --- a/ext/POSIX/t/sysconf.t +++ b/ext/POSIX/t/sysconf.t @@ -130,7 +130,7 @@ SKIP: { or skip("could not create fifo $fifo ($!)", 2 * 3 * @path_consts_fifo); SKIP: { - my $fd = POSIX::open($fifo, O_RDWR) + my $fd = POSIX::open($fifo, O_RDONLY | O_NONBLOCK) or skip("could not open $fifo ($!)", 3 * @path_consts_fifo); for my $constant (@path_consts_fifo) { |