From: Paul Smith Date: Sat, 26 Feb 2022 23:30:00 +0000 (-0500) Subject: Remove extraneous characters from fatal() calls X-Git-Tag: 4.3.90~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=236589642ed15c4231f618433d0a0daa52b9fa79;p=thirdparty%2Fmake.git 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 (): 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. --- diff --git a/src/amiga.c b/src/amiga.c index 9f9b546a..ec0ca143 100644 --- a/src/amiga.c +++ b/src/amiga.c @@ -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; diff --git a/src/file.c b/src/file.c index f9ef596c..2afad872 100644 --- a/src/file.c +++ b/src/file.c @@ -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; diff --git a/src/job.c b/src/job.c index 052934f7..8d1bdefb 100644 --- a/src/job.c +++ b/src/job.c @@ -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); } diff --git a/src/load.c b/src/load.c index e4f551a3..f86027d3 100644 --- a/src/load.c +++ b/src/load.c @@ -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 */ diff --git a/src/main.c b/src/main.c index 80059110..be0c8741 100644 --- a/src/main.c +++ b/src/main.c @@ -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; diff --git a/tests/scripts/targets/NOTINTERMEDIATE b/tests/scripts/targets/NOTINTERMEDIATE index bf4cb52e..e4690b12 100644 --- a/tests/scripts/targets/NOTINTERMEDIATE +++ b/tests/scripts/targets/NOTINTERMEDIATE @@ -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!