summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1997-08-18 18:11:04 +0000
committerPaul Smith <psmith@gnu.org>1997-08-18 18:11:04 +0000
commit63dff1e0bcb9e1bdd189e4a3e0d6126389251885 (patch)
treef8b39c21a6c709622d4fcc18f40539477a5ceb1a /job.c
parente746a9c9510b2cc83548e8d9108eb24540e7a821 (diff)
downloadgunmake-63dff1e0bcb9e1bdd189e4a3e0d6126389251885.tar.gz
Bug fixes and automake changes.
Diffstat (limited to 'job.c')
-rw-r--r--job.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/job.c b/job.c
index f00b6af..9d11ffc 100644
--- a/job.c
+++ b/job.c
@@ -785,6 +785,18 @@ start_job_command (child)
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
? "%s" : (char *) 0, p);
+ /* Optimize an empty command. People use this for timestamp rules,
+ and forking a useless shell all the time leads to inefficiency. */
+
+ if ((argv[0] && !strcmp(argv[0], "/bin/sh"))
+ && (argv[1] && !strcmp(argv[1], "-c"))
+ && (argv[2] && !strcmp(argv[2], ":"))
+ && argv[3] == NULL)
+ {
+ set_command_state (child->file, cs_running);
+ goto next_command;
+ }
+
/* Tell update_goal_chain that a command has been started on behalf of
this target. It is important that this happens here and not in
reap_children (where we used to do it), because reap_children might be