summaryrefslogtreecommitdiff
path: root/src/job.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2019-09-03 16:17:50 -0400
committerPaul Smith <psmith@gnu.org>2019-09-07 18:27:26 -0400
commit005a251689d90d4cd311151e5da7015719b918b9 (patch)
tree1d53fc19ee524aa81a50c0ece0607f8954a1306c /src/job.h
parent76b6e668a60d4c1eff5e231198f52e6d5f948be1 (diff)
downloadmake-git-005a251689d90d4cd311151e5da7015719b918b9.tar.gz
Show useful errors when posix_spawn() doesn't do so
The posix_spawn() function may not detect that the command to run is invalid when it's invoked. Instead, it will run then exit with error code 127. If that happens do our best to present the user with a useful error message. * src/job.h (struct child): Add cmd_name to hold the command we ran. * src/job.c (start_job_command): On success, remember the cmd_name. (reap_children): On exit 127, stat cmd_name and show a useful error. (free_child): Free cmd_name.
Diffstat (limited to 'src/job.h')
-rw-r--r--src/job.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/job.h b/src/job.h
index 54659430..339d7232 100644
--- a/src/job.h
+++ b/src/job.h
@@ -29,6 +29,7 @@ struct child
char *sh_batch_file; /* Script file for shell commands */
char **command_lines; /* Array of variable-expanded cmd lines. */
char *command_ptr; /* Ptr into command_lines[command_line]. */
+ char *cmd_name; /* Alloced copy of argv[0] that was run. */
struct output output; /* Output for this child. */