From patchwork Sun Mar 14 20:41:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahar Havivi X-Patchwork-Id: 47732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BF7DAB7D6A for ; Mon, 15 Mar 2010 07:42:28 +1100 (EST) Received: from localhost ([127.0.0.1]:59289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nqudk-0002x9-6S for incoming@patchwork.ozlabs.org; Sun, 14 Mar 2010 16:42:24 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqudB-0002wA-T1 for qemu-devel@nongnu.org; Sun, 14 Mar 2010 16:41:49 -0400 Received: from [199.232.76.173] (port=40228 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqudA-0002v3-Ex for qemu-devel@nongnu.org; Sun, 14 Mar 2010 16:41:48 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nqud9-0000ot-4E for qemu-devel@nongnu.org; Sun, 14 Mar 2010 16:41:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33019) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nqud8-0000ok-MW for qemu-devel@nongnu.org; Sun, 14 Mar 2010 16:41:46 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2EKfjiK014268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 14 Mar 2010 16:41:46 -0400 Received: from localhost (dhcp-1-229.tlv.redhat.com [10.35.1.229]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2EKfiiQ022619 for ; Sun, 14 Mar 2010 16:41:44 -0400 Date: Sun, 14 Mar 2010 22:41:15 +0200 From: Shahar Havivi To: qemu-devel@nongnu.org Message-ID: <20100314204111.GA9351@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] Restore terminal monitor attributes - addition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Patch 2d753894c7553d6a05e8fdbed5f4704398919a35 was missing this check, when running monitor as /dev/tty and other serial device, i.e: qemu -monitor /dev/tty -serial /dev/pts/1 Without this patch any serial device will override the monitor stored attributes. (monitor is called in main() before any serial device). Signed-off-by: Shahar Havivi --- qemu-char.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 0e25ef3..4bf1e82 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1002,7 +1002,9 @@ static void tty_serial_init(int fd, int speed, speed, parity, data_bits, stop_bits); #endif tcgetattr (fd, &tty); - oldtty = tty; + if (!term_atexit_done) { + oldtty = tty; + } #define check_speed(val) if (speed <= val) { spd = B##val; break; } speed = speed * 10 / 11;