Remove extraneous characters from fatal() calls

The fatal() method adds ".  Stop.\n" to every message.

* src/amiga.c (MyExecute): Remove newline from fatal() message.
* src/job.c (<various>): Ditto.
* src/file.c (snap_deps): Remove "." from fatal() message.
* src/main.c (main): Ditto.
* src/load.c: Ditto.
* tests/scripts/targets/NOTINTERMEDIATE: Fix expected output.
This commit is contained in:
Paul Smith 2022-02-26 18:30:00 -05:00
parent cb9ac2b0cc
commit 236589642e
6 changed files with 18 additions and 18 deletions

View file

@ -42,7 +42,7 @@ MyExecute (char **argv)
buffer = AllocMem (len, MEMF_ANY);
if (!buffer)
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command");
ptr = buffer;

View file

@ -816,7 +816,7 @@ snap_deps (void)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
if (f2->notintermediate)
OS (fatal, NILF,
_("%s cannot be both .NOTINTERMEDIATE and .INTERMEDIATE."),
_("%s cannot be both .NOTINTERMEDIATE and .INTERMEDIATE"),
f2->name);
else
f2->intermediate = 1;
@ -831,7 +831,7 @@ snap_deps (void)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
if (f2->notintermediate)
OS (fatal, NILF,
_("%s cannot be both .NOTINTERMEDIATE and .SECONDARY."),
_("%s cannot be both .NOTINTERMEDIATE and .SECONDARY"),
f2->name);
else
f2->intermediate = f2->secondary = 1;

View file

@ -367,7 +367,7 @@ create_batch_file (char const *base, int unixy, int *fd)
*fd = -1;
if (error_string == NULL)
error_string = _("Cannot create a temporary file\n");
error_string = _("Cannot create a temporary file");
O (fatal, NILF, error_string);
/* not reached */
@ -1109,7 +1109,7 @@ free_child (struct child *child)
output_close (&child->output);
if (!jobserver_tokens)
ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left",
child, child->file->name);
/* If we're using the jobserver and this child is not the only outstanding
@ -1865,7 +1865,7 @@ new_job (struct file *file)
/* There must be at least one child already, or we have no business
waiting for a token. */
if (!children)
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read\n");
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read");
/* Get a token. */
got_token = jobserver_acquire (waiting_jobs != NULL);
@ -2186,7 +2186,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
{
save_fdin = dup (FD_STDIN);
if (save_fdin < 0)
O (fatal, NILF, _("no more file handles: could not duplicate stdin\n"));
O (fatal, NILF, _("no more file handles: could not duplicate stdin"));
fd_noinherit (save_fdin);
dup2 (fdin, FD_STDIN);
@ -2198,7 +2198,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
save_fdout = dup (FD_STDOUT);
if (save_fdout < 0)
O (fatal, NILF,
_("no more file handles: could not duplicate stdout\n"));
_("no more file handles: could not duplicate stdout"));
fd_noinherit (save_fdout);
dup2 (fdout, FD_STDOUT);
@ -2212,7 +2212,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
save_fderr = dup (FD_STDERR);
if (save_fderr < 0)
O (fatal, NILF,
_("no more file handles: could not duplicate stderr\n"));
_("no more file handles: could not duplicate stderr"));
fd_noinherit (save_fderr);
}
@ -2227,7 +2227,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
if (save_fdin >= 0)
{
if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
O (fatal, NILF, _("Could not restore stdin\n"));
O (fatal, NILF, _("Could not restore stdin"));
else
close (save_fdin);
}
@ -2235,7 +2235,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
if (save_fdout >= 0)
{
if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
O (fatal, NILF, _("Could not restore stdout\n"));
O (fatal, NILF, _("Could not restore stdout"));
else
close (save_fdout);
}
@ -2243,7 +2243,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
if (save_fderr >= 0)
{
if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
O (fatal, NILF, _("Could not restore stderr\n"));
O (fatal, NILF, _("Could not restore stderr"));
else
close (save_fderr);
}

View file

@ -253,7 +253,7 @@ load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
{
if (! noerror)
O (fatal, flocp,
_("The 'load' operation is not supported on this platform."));
_("The 'load' operation is not supported on this platform"));
return 0;
}
@ -261,7 +261,7 @@ load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
void
unload_file (const char *name UNUSED)
{
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported!");
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported");
}
#endif /* MAKE_LOAD */

View file

@ -1789,7 +1789,7 @@ main (int argc, char **argv, char **envp)
if (stdin_nm)
O (fatal, NILF,
_("Makefile from standard input specified twice."));
_("Makefile from standard input specified twice"));
#ifdef VMS
# define DEFAULT_TMPDIR "/sys$scratch/"
@ -2465,7 +2465,7 @@ main (int argc, char **argv, char **envp)
}
if (bad)
O (fatal, NILF,
_("Couldn't change back to original directory."));
_("Couldn't change back to original directory"));
}
++restarts;

View file

@ -48,13 +48,13 @@ hello.z:
run_make_test(q!
.INTERMEDIATE: hello.x
.NOTINTERMEDIATE: hello.x
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .INTERMEDIATE.. Stop.\n", 512);
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .INTERMEDIATE. Stop.\n", 512);
# Test 6. Same file cannot be secondary and notintermediate.
run_make_test(q!
.SECONDARY: hello.x
.NOTINTERMEDIATE: hello.x
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .SECONDARY.. Stop.\n", 512);
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .SECONDARY. Stop.\n", 512);
# Test 7. All .SECONDARY and all .NOTINTERMEDIATE are mutually exclusive.
run_make_test(q!