diff options
author | Karl Williamson <khw@cpan.org> | 2020-04-09 12:02:12 -0600 |
---|---|---|
committer | Sawyer X <xsawyerx@cpan.org> | 2020-05-27 11:09:32 +0300 |
commit | 28bfed14e7471c9d91c7ca03b095d6b8899c85ab (patch) | |
tree | 8db5d58bbfdd1360c99365c9d661a742d3285843 | |
parent | 900fde54b03c8c8b6fbbb129e343df7887c25d3f (diff) | |
download | perl-28bfed14e7471c9d91c7ca03b095d6b8899c85ab.tar.gz |
op/exec.t: ENOTDIR is a legit errno
This test file does a system() on a non-existent file, and checks
that an error happens, and that the errno is one that is expected.
Prior to this commit it didn't think that ENOTDIR could happen.
But it can If PATH contains a component that is plain file, or, on some
systems, a component simply doesn't exist.
I examined the possible errnos listed in a Linux man page for this, and
this looked to be the only one that is likely to come up that weren't
already covered.
This fixes GH #17515
-rw-r--r-- | t/op/exec.t | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/t/op/exec.t b/t/op/exec.t index c676a972d1..e658d2e1ec 100644 --- a/t/op/exec.t +++ b/t/op/exec.t @@ -113,6 +113,8 @@ unless( ok($rc == 255 << 8 or $rc == -1 or $rc == 256 or $rc == 512) ) { unless ( ok( $! == 2 or $! =~ /\bno\b.*\bfile/i or $! == 13 or $! =~ /permission denied/i or + $! == 20 or $! =~ /not a directory/i or # If PATH component is + # a non-directory $! == 22 or $! =~ /invalid argument/i ) ) { diag sprintf "\$! eq %d, '%s'\n", $!, $!; } |