Module Name:    src
Committed By:   uebayasi
Date:           Sat Oct 11 15:47:38 UTC 2014

Modified Files:
        src/usr.bin/config: main.c sem.c

Log Message:
More debug messages.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/config/main.c
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/config/sem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.66 src/usr.bin/config/main.c:1.67
--- src/usr.bin/config/main.c:1.66	Sat Oct 11 09:09:19 2014
+++ src/usr.bin/config/main.c	Sat Oct 11 15:47:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.66 2014/10/11 09:09:19 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.67 2014/10/11 15:47:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -1006,6 +1006,7 @@ void
 deloption(const char *name)
 {
 
+	CFGDBG(4, "deselecting opt `%s'", name);
 	if (undo_option(opttab, &options, &nextopt, name, "options"))
 		return;
 	if (undo_option(selecttab, NULL, NULL, strtolower(name), "options"))
@@ -1054,6 +1055,7 @@ delfsoption(const char *name)
 {
 	const char *n;
 
+	CFGDBG(4, "deselecting fs `%s'", name);
 	n = strtolower(name);
 	if (undo_option(fsopttab, &fsoptions, &nextfsopt, name, "file-system"))
 		return;
@@ -1075,6 +1077,7 @@ void
 delmkoption(const char *name)
 {
 
+	CFGDBG(4, "deselecting mkopt `%s'", name);
 	(void)undo_option(mkopttab, &mkoptions, &nextmkopt, name,
 	    "makeoptions");
 }
@@ -1151,8 +1154,10 @@ undo_option(struct hashtab *ht, struct n
 			cfgwarn("%s `%s' is not defined", type, name);
 		return (1);
 	}
-	if (npp == NULL)
+	if (npp == NULL) {
+		CFGDBG(2, "opt `%s' deselected", name);
 		return (0);
+	}
 
 	for ( ; *npp != NULL; npp = &(*npp)->nv_next) {
 		if ((*npp)->nv_name != name)
@@ -1160,6 +1165,7 @@ undo_option(struct hashtab *ht, struct n
 		if (next != NULL && *next == &(*npp)->nv_next)
 			*next = npp;
 		nv = (*npp)->nv_next;
+		CFGDBG(2, "opt `%s' deselected", (*npp)->nv_name);
 		nvfree(*npp);
 		*npp = nv;
 		return (0);

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.60 src/usr.bin/config/sem.c:1.61
--- src/usr.bin/config/sem.c:1.60	Sat Oct 11 15:20:36 2014
+++ src/usr.bin/config/sem.c	Sat Oct 11 15:47:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.60 2014/10/11 15:20:36 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.61 2014/10/11 15:47:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -1043,6 +1043,7 @@ delconf(const char *name)
 {
 	struct config *cf;
 
+	CFGDBG(5, "deselecting config `%s'", name);
 	if (ht_lookup(cfhashtab, name) == NULL) {
 		cfgerror("configuration `%s' undefined", name);
 		return;
@@ -1260,6 +1261,7 @@ deldevi(const char *name, const char *at
 	int unit;
 	char base[NAMESIZE];
 
+	CFGDBG(5, "deselecting devi `%s'", name);
 	if (split(name, strlen(name), base, sizeof base, &unit)) {
 		cfgerror("invalid device name `%s'", name);
 		return;
@@ -1464,6 +1466,7 @@ deldeva(const char *at)
 	} else {
 		int l;
 
+		CFGDBG(5, "deselecting deva `%s'", at);
 		l = strlen(at) - 1;
 		if (at[l] == '?' || isdigit((unsigned char)at[l])) {
 			char base[NAMESIZE];
@@ -1547,6 +1550,7 @@ deldev(const char *name)
 	struct devi *firsti, *i;
 	struct nvlist *nv, *stack = NULL;
 
+	CFGDBG(5, "deselecting dev `%s'", name);
 	l = strlen(name) - 1;
 	if (name[l] == '*' || isdigit((unsigned char)name[l])) {
 		/* `no mydev0' or `no mydev*' */
@@ -1697,6 +1701,7 @@ delpseudo(const char *name)
 	struct devbase *d;
 	struct devi *i;
 
+	CFGDBG(5, "deselecting pseudo `%s'", name);
 	d = ht_lookup(devbasetab, name);
 	if (d == NULL) {
 		cfgerror("undefined pseudo-device %s", name);

Reply via email to