mirror of
https://github.com/mirror/make.git
synced 2025-03-03 14:20:54 +08:00
* src/job.c (child_execute_job): Use errno from find_in_given_path().
* tests/test_driver.pl: Determine non-executable error message. * tests/scripts/features/errors: Use the local non-executable error.
This commit is contained in:
parent
8acb89c8c4
commit
02a4c2913a
@ -2376,7 +2376,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
|
||||
if (!cmd)
|
||||
{
|
||||
r = ENOENT;
|
||||
r = errno;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -60,15 +60,17 @@ run_make_test(undef, 'two',
|
||||
|
||||
# Try failing due to non-executable file
|
||||
|
||||
my $noexe = './barfooblatboz';
|
||||
touch($noexe);
|
||||
if ($ERR_nonexe_file) {
|
||||
my $noexe = './barfooblatboz';
|
||||
touch($noexe);
|
||||
|
||||
run_make_test(qq!
|
||||
one: ; -$noexe xx yy
|
||||
two: ; $noexe aa bb
|
||||
!,
|
||||
'one', "$noexe xx yy\n#MAKE#: $noexe: Permission denied\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n");
|
||||
run_make_test(qq!
|
||||
one: ; -$noexe xx yy
|
||||
two: ; $noexe aa bb
|
||||
!,
|
||||
'one', "$noexe xx yy\n#MAKE#: $noexe: $ERR_nonexe_file\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n");
|
||||
|
||||
unlink($noexe);
|
||||
unlink($noexe);
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -68,6 +68,7 @@ if ($has_POSIX) {
|
||||
$ERR_no_such_file = undef;
|
||||
$ERR_read_only_file = undef;
|
||||
$ERR_unreadable_file = undef;
|
||||
$ERR_noexe_file = undef;
|
||||
|
||||
if (open(my $F, '<', 'file.none')) {
|
||||
print "Opened non-existent file! Skipping related tests.\n";
|
||||
@ -86,6 +87,13 @@ if (open(my $F, '>', 'file.out')) {
|
||||
$ERR_read_only_file = "$!";
|
||||
}
|
||||
|
||||
$_ = `./file.out`;
|
||||
if ($? == 0) {
|
||||
print "Executed non-executable file! Skipping related tests.\n";
|
||||
} else {
|
||||
$ERR_nonexe_file = "$!";
|
||||
}
|
||||
|
||||
chmod(0000, 'file.out');
|
||||
if (open(my $F, '<', 'file.out')) {
|
||||
print "Opened unreadable file! Skipping related tests.\n";
|
||||
|
Loading…
Reference in New Issue
Block a user