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;
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)
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. */
/* sub_proc.c is limited in the number of objects it can wait for. */
if (style && strcmp (style, "sem") != 0)
- OS (fatal, NILF, _("Unknown jobserver auth style '%s'"), style);
+ OS (fatal, NILF, _("unknown jobserver auth style '%s'"), style);
if (slots > process_table_usable_size())
{
slots = process_table_usable_size();
- DB (DB_JOBS, (_("Jobserver slots limited to %d\n"), slots));
+ DB (DB_JOBS, (_("jobserver slots limited to %d\n"), slots));
}
sprintf (jobserver_semaphore_name, "gmake_semaphore_%d", _getpid ());
{
DWORD err = GetLastError ();
const char *estr = map_windows32_error_to_string (err);
- fatal (NILF, strlen (auth) + INTSTR_LENGTH + strlen (estr),
- _("internal error: unable to open jobserver semaphore '%s': (Error %ld: %s)"),
+ error (NILF, strlen (auth) + INTSTR_LENGTH + strlen (estr),
+ _("unable to open jobserver semaphore '%s': (Error %ld: %s)"),
auth, err, estr);
+ return 0;
}
+
DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), auth));
return 1;
# Shorthand
my $np = '--no-print-directory';
+my $j1err = "warning: jobserver unavailable: using -j1. Add '+' to parent make rule.";
# Simple test of MAKEFLAGS settings
run_make_test(q!
default: ; @ #MAKEPATH# -f Makefile2
!,
"--jobserver-style=pipe -j2 $np",
-"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
+"#MAKE#[1]: $j1err
#MAKE#[1]: Nothing to be done for 'foo'.");
rmfiles('Makefile2');
# For Windows and named pipes, we don't need to worry about recursion
if ($port_type eq 'W32' || exists $FEATURES{'jobserver-fifo'}) {
- create_file('Makefile2', "vpath %.c ../\n", "foo:\n");
+ create_file('Makefile2', "vpath %.c ../\n", "foo:\n");
- run_make_test(q!
+ run_make_test(q!
default: ; @ #MAKEPATH# -f Makefile2
!,
"-j2 $np",
"#MAKE#[1]: Nothing to be done for 'foo'.");
- rmfiles('Makefile2');
+ rmfiles('Makefile2');
}
# Ensure enter/leave directory messages appear before jobserver warnings
all a: ; @echo $@
!,
'--jobserver-style=foo -j8',
- "#MAKE#: *** Unknown jobserver auth style 'foo'. Stop.", 512);
-
-# sv 62908.
-# Test that when mkfifo fails, make switches to pipe and succeeds.
-# Force mkfifo to fail by attempting to create a fifo in a non existent
-# directory.
-# run_make_test does not allow matching a multiline pattern, therefore run the
-# test twice.
-# First time look for /$ERR_no_such_file/ to ensure mkfifo failed.
-# Second time look for /Nothing to be done/ to ensure make succeeded.
+ "#MAKE#: *** unknown jobserver auth style 'foo'. Stop.", 512);
+
if (exists $FEATURES{'jobserver-fifo'}) {
+ # sv 62908.
+ # Test that when mkfifo fails, make switches to pipe and succeeds.
+ # Force mkfifo to fail by attempting to create a fifo in a non existent
+ # directory.
+ # run_make_test does not allow matching a multiline pattern, therefore run
+ # the test twice.
+ # First time look for /$ERR_no_such_file/ to ensure mkfifo failed.
+ # Second time look for /Nothing to be done/ to ensure make succeeded.
$ENV{TMPDIR} = "nosuchdir";
run_make_test("all:\n", '-j2', "/$ERR_no_such_file/");
all:;@echo "$$MAKEFLAGS"
!,
"-j2 --no-print-directory", "/--jobserver-auth=fifo:\\./");
+
+ # Verify we fall back to -j1 but continue, of the auth is bad.
+ $ENV{MAKEFLAGS} = '-j2 --jobserver-auth=fifo:nosuchfile';
+ run_make_test(q!all:;@echo hi!, "", "#MAKE#: cannot open jobserver nosuchfile: $ERR_no_such_file\n#MAKE#: $j1err\nhi\n");
}
1;