diff options
author | Paul Smith <psmith@gnu.org> | 2022-11-07 15:55:21 -0500 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-11-13 10:39:48 -0500 |
commit | 4c9d87f4ae938a20fc21d2a0538c74dad0518f20 (patch) | |
tree | 0e55d21729c36dfc04d56fbfb0d53126a210ee25 /src/posixos.c | |
parent | bb5df351330e677892818bb3c7f962b606082278 (diff) | |
download | make-git-4c9d87f4ae938a20fc21d2a0538c74dad0518f20.tar.gz |
Keep going if we can't connect to the jobserver
* src/posixos.c (jobserver_parse_auth): Don't invoke fatal() if we
can't connect to an existing jobserver: just keep going without it.
* src/w32/w32os.c (jobserver_parse_auth): Ditto.
* tests/scripts/features/jobserver: Add a test for invalid FIFO
auth files.
Diffstat (limited to 'src/posixos.c')
-rw-r--r-- | src/posixos.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/posixos.c b/src/posixos.c index 44aeb346..3d7d6614 100644 --- a/src/posixos.c +++ b/src/posixos.c @@ -167,12 +167,12 @@ jobserver_setup (int slots, const char *style) hang until the write side is open. */ EINTRLOOP (job_fds[0], open (fifo_name, O_RDONLY|O_NONBLOCK)); if (job_fds[0] < 0) - OSS (fatal, NILF, _("Cannot open jobserver %s: %s"), + OSS (fatal, NILF, _("cannot open jobserver %s: %s"), fifo_name, strerror (errno)); EINTRLOOP (job_fds[1], open (fifo_name, O_WRONLY)); if (job_fds[0] < 0) - OSS (fatal, NILF, _("Cannot open jobserver %s: %s"), + OSS (fatal, NILF, _("cannot open jobserver %s: %s"), fifo_name, strerror (errno)); js_type = js_fifo; @@ -183,7 +183,7 @@ jobserver_setup (int slots, const char *style) if (js_type == js_none) { if (style && strcmp (style, "pipe") != 0) - OS (fatal, NILF, _("Unknown jobserver auth style '%s'"), style); + OS (fatal, NILF, _("unknown jobserver auth style '%s'"), style); EINTRLOOP (r, pipe (job_fds)); if (r < 0) @@ -229,14 +229,19 @@ jobserver_parse_auth (const char *auth) EINTRLOOP (job_fds[0], open (fifo_name, O_RDONLY)); if (job_fds[0] < 0) - OSS (fatal, NILF, - _("Cannot open jobserver %s: %s"), fifo_name, strerror (errno)); + { + OSS (error, NILF, + _("cannot open jobserver %s: %s"), fifo_name, strerror (errno)); + return 0; + } EINTRLOOP (job_fds[1], open (fifo_name, O_WRONLY)); - if (job_fds[0] < 0) - OSS (fatal, NILF, - _("Cannot open jobserver %s: %s"), fifo_name, strerror (errno)); - + if (job_fds[1] < 0) + { + OSS (error, NILF, + _("cannot open jobserver %s: %s"), fifo_name, strerror (errno)); + return 0; + } js_type = js_fifo; } /* If not, it must be a simple pipe. */ |