Re: [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14

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

 



On Thu, Oct 27, 2005 at 11:27:42PM +0200, Roman Zippel wrote:
>
> On Thu, 27 Oct 2005, Fao, Sean wrote:
>
> > This patch is a functionality modification that implements a proposed design
> > change to lxdialog.  Specifically, this patch makes use of the proposed
> > "Abort" functionality of lxdialog, which adds an "Abort" button in addition
> > to the "Yes" and "No" buttons that are currently displayed when a user exits
> > kconfig.  The Abort button allows a user to return to the root menu of
> > kconfig rather than exiting.
>
> This reminds me I had a similiar patch lying around, could you use this
> one as a basis.

I like your patch because it was the same idea and one less variable.  The
only thing that worries me is that the return value from "changes NOT saved"
is 0 rather than 1, which the original returned.  Is there any reason for
this?

Signed-off-by: Sean Fao <[email protected]>

---

--- linux-2.6.14/scripts/kconfig/mconf.c	2005-10-27 19:02:08.000000000 -0500
+++ linux/scripts/kconfig/mconf.c	2005-11-03 10:49:43.000000000 -0500
@@ -1064,34 +1064,37 @@ int main(int ac, char **av)
 	tcgetattr(1, &ios_org);
 	atexit(conf_cleanup);
 	init_wsize();
-	conf(&rootmenu);
+	while (1) {
+		conf(&rootmenu);
 
-	do {
-		cprint_init();
-		cprint("--yesno");
-		cprint(_("Do you wish to save your new kernel configuration?"));
-		cprint("5");
-		cprint("60");
-		stat = exec_conf();
-	} while (stat < 0);
+		do {
+			cprint_init();
+			cprint("--yesnoabort");
+			cprint(_("Do you wish to save your new kernel configuration?"));
+			cprint("5");
+			cprint("60");
+			stat = exec_conf();
+		} while (stat < 0);
 
-	if (stat == 0) {
-		if (conf_write(NULL)) {
+		switch (stat) {
+		case 0:
+			if (conf_write(NULL)) {
+				fprintf(stderr, _("\n\n"
+					"Error during writing of the kernel configuration.\n"
+					"Your kernel configuration changes were NOT saved."
+					"\n\n"));
+				return 1;
+			}
+			printf(_("\n\n"
+				"*** End of Linux kernel configuration.\n"
+				"*** Execute 'make' to build the kernel or try 'make help'."
+				"\n\n"));
+			return 0;
+		case 1:
 			fprintf(stderr, _("\n\n"
-				"Error during writing of the kernel configuration.\n"
 				"Your kernel configuration changes were NOT saved."
 				"\n\n"));
-			return 1;
+			return 0;
 		}
-		printf(_("\n\n"
-			"*** End of Linux kernel configuration.\n"
-			"*** Execute 'make' to build the kernel or try 'make help'."
-			"\n\n"));
-	} else {
-		fprintf(stderr, _("\n\n"
-			"Your kernel configuration changes were NOT saved."
-			"\n\n"));
 	}
-
-	return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux