From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lvdgb-00017T-S1 for qemu-devel@nongnu.org; Sun, 19 Apr 2009 16:32:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lvdga-000170-ME for qemu-devel@nongnu.org; Sun, 19 Apr 2009 16:32:21 -0400 Received: from [199.232.76.173] (port=43075 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lvdga-00016x-IN for qemu-devel@nongnu.org; Sun, 19 Apr 2009 16:32:20 -0400 Received: from lechat.rtp-net.org ([88.191.19.38]:54597) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lvdga-0000cV-8T for qemu-devel@nongnu.org; Sun, 19 Apr 2009 16:32:20 -0400 Received: from lechat.rtp-net.org (localhost [127.0.0.1]) by lechat.rtp-net.org (Postfix) with ESMTP id 2BD1E10087 for ; Sun, 19 Apr 2009 22:38:47 +0200 (CEST) From: Arnaud Patard (Rtp) Date: Sun, 19 Apr 2009 22:38:47 +0200 Message-ID: <87vdp0fkfc.fsf@lechat.rtp-net.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: [Qemu-devel] [PATCH] Fix struct termios host - target translation 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 --=-=-= 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). Signed-off-by: Arnaud Patard --- --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=fix_termios.patch 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]; --=-=-=--