From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvtKK-0002am-SL for qemu-devel@nongnu.org; Mon, 20 Apr 2009 09:14:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvtKI-0002ZG-Ng for qemu-devel@nongnu.org; Mon, 20 Apr 2009 09:14:23 -0400 Received: from [199.232.76.173] (port=36953 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvtKI-0002Z9-Kk for qemu-devel@nongnu.org; Mon, 20 Apr 2009 09:14:22 -0400 Received: from mx20.gnu.org ([199.232.41.8]:45609) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LvtKI-00031E-Ad for qemu-devel@nongnu.org; Mon, 20 Apr 2009 09:14:22 -0400 Received: from naru.obs2.net ([84.20.150.76]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvtKG-0002tY-AL for qemu-devel@nongnu.org; Mon, 20 Apr 2009 09:14:20 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id AFE52327404E for ; Mon, 20 Apr 2009 16:14:14 +0300 (EEST) Date: Mon, 20 Apr 2009 16:14:14 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] Fix struct termios host - target translation Message-ID: <20090420131414.GA10865@kos.to> References: <87vdp0fkfc.fsf@lechat.rtp-net.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vdp0fkfc.fsf@lechat.rtp-net.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sun, Apr 19, 2009 at 10:38:47PM +0200, Arnaud Patard wrote: > When converting the termios structure between host and target in > target_to_host_termios and host_to_target_termios, the c_cc[] array is > never initialised. > Calling memset() before using it allows to run successfully "stty echo / > stty -echo" on arm-linux-user target (host being x86 and mips). Looks correct to me, and can verify that stty now works better on arm/amd64 target/host combo. Acked-by: Riku Voipio > Signed-off-by: Arnaud Patard > --- > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 2d51d6b..2d876c1 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -2527,6 +2527,7 @@ static void target_to_host_termios (void *dst, const void *src) > target_to_host_bitmask(tswap32(target->c_lflag), lflag_tbl); > host->c_line = target->c_line; > > + memset(host->c_cc, 0, sizeof(host->c_cc)); > host->c_cc[VINTR] = target->c_cc[TARGET_VINTR]; > host->c_cc[VQUIT] = target->c_cc[TARGET_VQUIT]; > host->c_cc[VERASE] = target->c_cc[TARGET_VERASE]; > @@ -2561,6 +2562,7 @@ static void host_to_target_termios (void *dst, const void *src) > tswap32(host_to_target_bitmask(host->c_lflag, lflag_tbl)); > target->c_line = host->c_line; > > + memset(target->c_cc, 0, sizeof(target->c_cc)); > target->c_cc[TARGET_VINTR] = host->c_cc[VINTR]; > target->c_cc[TARGET_VQUIT] = host->c_cc[VQUIT]; > target->c_cc[TARGET_VERASE] = host->c_cc[VERASE]; >