Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: remove usage message if the debug file ca...



details:   https://anonhg.NetBSD.org/src/rev/f089139378a1
branches:  trunk
changeset: 1029216:f089139378a1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 27 22:22:48 2021 +0000

description:
make: remove usage message if the debug file cannot be opened

Since a non-writable file is not a syntax error, there is no point in
showing the usage in this situation.  Showing the usage may have been a
copy-and-paste mistake from a few lines below, when this option was
added back in main.c 1.133 from 2006-10-15.

diffstat:

 usr.bin/make/main.c                        |  8 ++++----
 usr.bin/make/unit-tests/opt-debug-file.exp |  6 +-----
 2 files changed, 5 insertions(+), 9 deletions(-)

diffs (41 lines):

diff -r 8a579528fe3c -r f089139378a1 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Mon Dec 27 22:04:20 2021 +0000
+++ b/usr.bin/make/main.c       Mon Dec 27 22:22:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.553 2021/12/27 21:27:25 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.554 2021/12/27 22:22:48 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.553 2021/12/27 21:27:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.554 2021/12/27 22:22:48 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -222,9 +222,9 @@
 
        opts.debug_file = fopen(fname, mode);
        if (opts.debug_file == NULL) {
-               fprintf(stderr, "Cannot open debug file %s\n",
+               fprintf(stderr, "Cannot open debug file \"%s\"\n",
                    fname);
-               usage();
+               exit(2);
        }
        free(fname);
 }
diff -r 8a579528fe3c -r f089139378a1 usr.bin/make/unit-tests/opt-debug-file.exp
--- a/usr.bin/make/unit-tests/opt-debug-file.exp        Mon Dec 27 22:04:20 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-file.exp        Mon Dec 27 22:22:48 2021 +0000
@@ -1,6 +1,2 @@
-Cannot open debug file opt-debug-file.debuglog/file
-usage: make [-BeikNnqrSstWwX]
-            [-C directory] [-D variable] [-d flags] [-f makefile]
-            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]
-            [-V variable] [-v variable] [variable=value] [target ...]
+Cannot open debug file "opt-debug-file.debuglog/file"
 exit status 2



Home | Main Index | Thread Index | Old Index