diff options
author | Paul Smith <psmith@gnu.org> | 1999-08-23 22:15:17 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-08-23 22:15:17 +0000 |
commit | 5dc4b92b606351290d979371da4a500ce8f6a57e (patch) | |
tree | b8d06830fdf21258b23c4759a4ae0ca53b1f5bea /main.c | |
parent | b3fa4b3c7e77cb4a1767b16b1cfbef2ab19a78cf (diff) | |
download | gunmake-5dc4b92b606351290d979371da4a500ce8f6a57e.tar.gz |
* Fix jobserver algorithm again.
* A couple of nits.
* Fix considered pruning for double-colon rules.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -1301,11 +1301,15 @@ int main (int argc, char ** argv) { char *cp; - if (jobserver_fds->max > 1) - fatal (NILF, _("internal error: multiple --jobserver-fds options.")); + if (jobserver_fds->idx > 1) + fatal (NILF, _("internal error: multiple --jobserver-fds options")); - if (job_slots > 0) - fatal (NILF, _("internal error: --jobserver-fds unexpected.")); + /* The combination of a pipe + !job_slots means we're using the + jobserver. If !job_slots and we don't have a pipe, we can start + infinite jobs. */ + + if (job_slots != 0) + fatal (NILF, _("internal error: --jobserver-fds unexpected")); /* Now parse the fds string and make sure it has the proper format. */ @@ -1313,13 +1317,7 @@ int main (int argc, char ** argv) if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2) fatal (NILF, - _("internal error: invalid --jobserver-fds string `%s'."), cp); - - /* Set job_slots to 0. The combination of a pipe + !job_slots means - we're using the jobserver. If !job_slots and we don't have a pipe, we - can start infinite jobs. */ - - job_slots = 0; + _("internal error: invalid --jobserver-fds string `%s'"), cp); /* Create a duplicate pipe, that will be closed in the SIGCHLD handler. If this fails with EBADF, the parent has closed the pipe @@ -1353,7 +1351,8 @@ int main (int argc, char ** argv) /* Every make assumes that it always has one job it can run. For the submakes it's the token they were given by their parent. For the - top make, we just subtract one from the number the user wants. */ + top make, we just subtract one from the number the user wants. We + want job_slots to be 0 to indicate we're using the jobserver. */ while (--job_slots) while (write (job_fds[1], &c, 1) != 1) |