Skip to contentSkip to conversation

kconfig: fix a regression when exiting menuconfig without saving

PATCH In review Li Zefan 4 participants 6 messages Jan 16, 2012

Subsystems (2)
lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 kconfig: fix a regression when exiting menuconfig without saving

$ make menuconfig
  HOSTCC  scripts/kconfig/mconf.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig

Your configuration changes were NOT saved.

make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2

Exiting menuconfig without saving, make will report error. This is a regression, and was introduced by

	commit 564899f9f0a2df85fa367c8749a1fef323cb3215
	Author: Davidlohr Bueso <[email protected]>
	Date:   Sun Aug 21 22:04:09 2011 -0300

	    kconfig: handle SIGINT in menuconfig
---
 scripts/kconfig/mconf.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
scripts/kconfig/mconf.c +2 -0
index 19e200d..2c6286c 100644
@@ -830,6 +830,8 @@ static int handle_exit(void)
 		fprintf(stderr, _("\n\n"
 				  "Your configuration changes were NOT saved."
 				  "\n\n"));
+		if (res != KEY_ESC)
+			res = 0;
 	}
 
 	return res;
Signature · 1 line
1.7.3.1
#1 lore raw
Quoted 11 lines · Li Zefan
$ make menuconfig
  HOSTCC  scripts/kconfig/mconf.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig

Your configuration changes were NOT saved.

make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2

Exiting menuconfig without saving, make will report error.

This should be fixed by "[PATCH] scripts:kconfig:mconf.c: let make not report error when not save configuration".

Thanks.

author
#2 lore raw
Quoted 8 lines · Cong Wang
Quoted 7 lines · Li Zefan
$ make menuconfig
  HOSTCC  scripts/kconfig/mconf.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig

Your configuration changes were NOT saved.

Quoted 8 lines
Quoted 4 lines

make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2

Exiting menuconfig without saving, make will report error.

This should be fixed by "[PATCH] scripts:kconfig:mconf.c: let make not report error when not save configuration".

I didn't notice that patch. I just took a look on it, and unfortunately that patch is wrong, in that now pressing ESC in the Yes/No dialog will exit menuconfig instead of returning to the main menu.

author
#3 lore raw

PATCH 1/1 menuconfig: fix a regression when canceling the prompt dialog at exit

This commit fixes a bug, while introducing a new one..

commit 7203ddbd4be9720649e47d756a001e0c7d7f8ae2

Author: Wang YanQing <[email protected]>
Date:   Thu Jan 12 11:31:32 2012 +0800

menuconfig: let make not report error when not save configuration

Pressing ESC should cancel the yes/no dialog and return back to the main menu, but not exit from menuconfig.

---
 scripts/kconfig/mconf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/kconfig/mconf.c +2 -1
index 86cd1ea..2c6286c 100644
@@ -830,7 +830,8 @@ static int handle_exit(void)
 		fprintf(stderr, _("\n\n"
 				  "Your configuration changes were NOT saved."
 				  "\n\n"));
-		res = 0;
+		if (res != KEY_ESC)
+			res = 0;
 	}
 
 	return res;
Signature · 1 line
1.7.3.1
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] menuconfig: fix a regression when canceling the prompt dialog at exit

Quoted 6 lines · Li Zefan

This commit fixes a bug, while introducing a new one..

commit 7203ddbd4be9720649e47d756a001e0c7d7f8ae2

Author: Wang YanQing <[email protected]>
Date:   Thu Jan 12 11:31:32 2012 +0800
Quoted 6 lines

menuconfig: let make not report error when not save configuration

Pressing ESC should cancel the yes/no dialog and return back to the main menu, but not exit from menuconfig.

Quoted 20 lines
---
 scripts/kconfig/mconf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/kconfig/mconf.c +2 -1
index 86cd1ea..2c6286c 100644
@@ -830,7 +830,8 @@ static int handle_exit(void)
 		fprintf(stderr, _("\n\n"
 				  "Your configuration changes were NOT saved."
 				  "\n\n"));
-		res = 0;
+		if (res != KEY_ESC)
+			res = 0;
 	}
 
 	return res;
Signature · 1 line
1.7.3.1
Applied
#5 lore raw

Re: [PATCH] menuconfig: fix a regression when canceling the prompt dialog at exit

In reply to Li Zefan
Quoted 10 lines · Li Zefan

This commit fixes a bug, while introducing a new one..

commit 7203ddbd4be9720649e47d756a001e0c7d7f8ae2

Author: Wang YanQing <[email protected]>
Date:   Thu Jan 12 11:31:32 2012 +0800

menuconfig: let make not report error when not save configuration

Pressing ESC should cancel the yes/no dialog and return back to the main menu, but not exit from menuconfig.

Thanks, applied. Note that in the Ctrl-C case, ESC still exits with an error. Changing sig_handler() to only exit if res != KEY_ESC is not sufficient, as the dialog is not redrawn. Hm.

Michal