diff options
Diffstat (limited to 'src/posixos.c')
-rw-r--r-- | src/posixos.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/posixos.c b/src/posixos.c index 9eecfcde..de19c889 100644 --- a/src/posixos.c +++ b/src/posixos.c @@ -121,6 +121,9 @@ jobserver_parse_auth (const char *auth) DB (DB_JOBS, (_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1])); + if (job_fds[0] == -2 || job_fds[1] == -2) + return 0; + #ifdef HAVE_FCNTL_H # define FD_OK(_f) (fcntl ((_f), F_GETFD) != -1) #else @@ -154,13 +157,21 @@ jobserver_parse_auth (const char *auth) } char * -jobserver_get_auth (void) +jobserver_get_auth () { char *auth = xmalloc ((INTSTR_LENGTH * 2) + 2); sprintf (auth, "%d,%d", job_fds[0], job_fds[1]); return auth; } +const char * +jobserver_get_invalid_auth () +{ + /* It's not really great that we are assuming the command line option + here but other alternatives are also gross. */ + return " --" JOBSERVER_AUTH_OPT "=-2,-2"; +} + unsigned int jobserver_enabled (void) { |