]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/job.c (child_execute_job): Use errno from find_in_given_path().
authorPaul Smith <psmith@gnu.org>
Sat, 14 Sep 2019 19:41:58 +0000 (15:41 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 16 Sep 2019 12:25:33 +0000 (08:25 -0400)
* tests/test_driver.pl: Determine non-executable error message.
* tests/scripts/features/errors: Use the local non-executable error.

src/job.c
tests/scripts/features/errors
tests/test_driver.pl

index 67194d1f55febec8f4f7c7220b66950ed4f5ec37..c7e7f7953e6116460f369447f556bc37c9ddc655 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -2376,7 +2376,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
 
   if (!cmd)
     {
-      r = ENOENT;
+      r = errno;
       goto cleanup;
     }
 
index eac64ed9b069ea111126272f3a21112c2ce488d2..ec49547b7d89b6c4d4a7804e7e417c0568975b2a 100644 (file)
@@ -60,15 +60,17 @@ run_make_test(undef, 'two',
 
 # Try failing due to non-executable 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");
-
-unlink($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: $ERR_nonexe_file\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n");
+
+    unlink($noexe);
+}
 
 1;
index 4af84dafc42600a1045c40c03c6510aa000e2d48..30e19435b1277b9bdf3af7ea7306093e00b56b57 100644 (file)
@@ -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";