git: cb8179079ab0 - main - stand: Fix warning about variable unused

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 01 May 2023 21:04:22 UTC
The branch main has been updated by imp:

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

commit cb8179079ab08263b0e3835655a83a8915f33eb4
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-05-01 15:35:16 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-05-01 21:02:54 +0000

    stand: Fix warning about variable unused
    
    dflag is unused when LOADER_VERIEXEC isn't defined, so move it under the
    ifdef.
    
    Sponsored by:           Netflix
---
 stand/common/module.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/stand/common/module.c b/stand/common/module.c
index 43c04728b4fa..9902309b7f99 100644
--- a/stand/common/module.c
+++ b/stand/common/module.c
@@ -114,10 +114,14 @@ command_load(int argc, char *argv[])
 	char	*typestr;
 #ifdef LOADER_VERIEXEC
 	char	*prefix, *skip;
+	int	dflag = 0;
+	char	*args = "dkp:s:t:";
+#else
+	char	*args = "kt:";
 #endif
-	int		dflag, dofile, dokld, ch, error;
+	int	dofile, dokld, ch, error;
 
-	dflag = dokld = dofile = 0;
+	dokld = dofile = 0;
 	optind = 1;
 	optreset = 1;
 	typestr = NULL;
@@ -129,11 +133,13 @@ command_load(int argc, char *argv[])
 	prefix = NULL;
 	skip = NULL;
 #endif
-	while ((ch = getopt(argc, argv, "dkp:s:t:")) != -1) {
+	while ((ch = getopt(argc, argv, args)) != -1) {
 		switch(ch) {
+#ifdef LOADER_VERIEXEC
 		case 'd':
 			dflag++;
 			break;
+#endif
 		case 'k':
 			dokld = 1;
 			break;