Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aBgEQ-0007JP-Fp for mharc-grub-devel@gnu.org; Wed, 23 Dec 2015 05:01:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBgEO-0007JF-Qt for grub-devel@gnu.org; Wed, 23 Dec 2015 05:01:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBgEJ-00033l-Sb for grub-devel@gnu.org; Wed, 23 Dec 2015 05:01:16 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:44134 helo=prv3-mh.provo.novell.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBgEJ-00032W-Mz for grub-devel@gnu.org; Wed, 23 Dec 2015 05:01:11 -0500 Received: from linux-dsax.tai.apac.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Wed, 23 Dec 2015 03:01:05 -0700 Date: Wed, 23 Dec 2015 17:49:45 +0800 From: Michael Chang To: grub-devel@gnu.org Subject: [PATCH] emu: fix unusable terminal after exit Message-ID: <20151223094945.GA17566@linux-dsax.tai.apac.novell.com> Mail-Followup-To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 137.65.250.26 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:01:17 -0000 The grub-emu's grub_exit function will exit immediately without any housekeeping work for restoring terminal settings and leaves unusable terminal in the end. Fix the problem by calling grub_reboot to allow doing the housekeeping work and restoring the terminal settings. --- grub-core/commands/minicmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c index a3a1182..63ffeb5 100644 --- a/grub-core/commands/minicmd.c +++ b/grub-core/commands/minicmd.c @@ -181,7 +181,11 @@ grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { +#if defined (GRUB_MACHINE_EMU) + grub_reboot (); +#else grub_exit (); +#endif /* Not reached. */ } -- 2.6.3