git: 1a4e959eb34a - main - sh: fix debug build

Piotr Pawel Stefaniak pstef at FreeBSD.org
Sun Apr 11 07:25:32 UTC 2021


The branch main has been updated by pstef:

URL: https://cgit.FreeBSD.org/src/commit/?id=1a4e959eb34ae03a96f6d0dea68b6a6a88ac4462

commit 1a4e959eb34ae03a96f6d0dea68b6a6a88ac4462
Author:     Piotr Pawel Stefaniak <pstef at FreeBSD.org>
AuthorDate: 2021-04-11 07:09:28 +0000
Commit:     Piotr Pawel Stefaniak <pstef at FreeBSD.org>
CommitDate: 2021-04-11 07:23:14 +0000

    sh: fix debug build
    
    Approved by:    jilles
---
 bin/sh/show.c | 7 +++----
 bin/sh/show.h | 2 ++
 bin/sh/trap.c | 4 ----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/bin/sh/show.c b/bin/sh/show.c
index 04dc123381af..01035d76093d 100644
--- a/bin/sh/show.c
+++ b/bin/sh/show.c
@@ -73,7 +73,7 @@ static void
 shtree(union node *n, int ind, char *pfx, FILE *fp)
 {
 	struct nodelist *lp;
-	char *s;
+	const char *s;
 
 	if (n == NULL)
 		return;
@@ -125,7 +125,7 @@ shcmd(union node *cmd, FILE *fp)
 {
 	union node *np;
 	int first;
-	char *s;
+	const char *s;
 	int dftfd;
 
 	first = 1;
@@ -274,8 +274,7 @@ indent(int amount, char *pfx, FILE *fp)
  */
 
 
-FILE *tracefile;
-
+static FILE *tracefile;
 #if DEBUG >= 2
 int debug = 1;
 #else
diff --git a/bin/sh/show.h b/bin/sh/show.h
index 1dbdaa152b33..790a62e2942c 100644
--- a/bin/sh/show.h
+++ b/bin/sh/show.h
@@ -39,4 +39,6 @@ void trargs(char **);
 void trputc(int);
 void trputs(const char *);
 void opentrace(void);
+
+extern int debug;
 #endif
diff --git a/bin/sh/trap.c b/bin/sh/trap.c
index d7a98604c22c..d7ef40274270 100644
--- a/bin/sh/trap.c
+++ b/bin/sh/trap.c
@@ -274,12 +274,8 @@ setsignal(int signo)
 			break;
 		case SIGQUIT:
 #ifdef DEBUG
-			{
-			extern int debug;
-
 			if (debug)
 				break;
-			}
 #endif
 			action = S_CATCH;
 			break;


More information about the dev-commits-src-all mailing list