diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2015-03-20 17:49:12 +0000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-06-02 10:16:40 +1000 |
commit | a33e5a9d6ea92122a718147da18425b38257c6f5 (patch) | |
tree | f203826b3d65642648d72e71270d45fda1dd3eef /t | |
parent | 4392616c924072673a06a91f2a51f6267f8063b2 (diff) | |
download | perl-a33e5a9d6ea92122a718147da18425b38257c6f5.tar.gz |
Handle fcntl(F_GETPIPE_SZ) failure in t/io/eintr.t
Even if the F_GETPIPE_SZ constant is defined, the fcntl() call can
fail (e.g. with EINVAL), so fall back to the default in that case.
Diffstat (limited to 't')
-rw-r--r-- | t/io/eintr.t | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/io/eintr.t b/t/io/eintr.t index ca15232e69..1a81cdf76b 100644 --- a/t/io/eintr.t +++ b/t/io/eintr.t @@ -102,10 +102,10 @@ ok(close($in), 'read/die: close status'); # consistently failing. At exactly 0x100000 it started passing # again. Now we're asking the kernel what the pipe buffer is, and if # that fails, hoping this number is bigger than any pipe buffer. -my $surely_this_arbitrary_number_is_fine = eval { +my $surely_this_arbitrary_number_is_fine = (eval { use Fcntl qw(F_GETPIPE_SZ); - fcntl($out, F_GETPIPE_SZ, 0) + 1; -} || 0x100000; + fcntl($out, F_GETPIPE_SZ, 0); +} || 0xfffff) + 1; # close during print |