From patchwork Thu Jan 28 18:44:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeniy Dushistov X-Patchwork-Id: 43877 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 4E5B9B7CFF for ; Fri, 29 Jan 2010 05:46:35 +1100 (EST) Received: from localhost ([127.0.0.1]:50790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaZNQ-0006bB-ML for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2010 13:46:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaZM0-0006Wp-60 for qemu-devel@nongnu.org; Thu, 28 Jan 2010 13:44:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaZLy-0006Tx-RO for qemu-devel@nongnu.org; Thu, 28 Jan 2010 13:44:31 -0500 Received: from [199.232.76.173] (port=45057 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaZLy-0006TF-JD for qemu-devel@nongnu.org; Thu, 28 Jan 2010 13:44:30 -0500 Received: from mx76.mail.ru ([94.100.176.91]:55651) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaZLy-0006Ye-6E for qemu-devel@nongnu.org; Thu, 28 Jan 2010 13:44:30 -0500 Received: from [79.134.90.104] (port=41671 helo=rain) by mx76.mail.ru with asmtp id 1NaZLv-000JAm-00 for qemu-devel@nongnu.org; Thu, 28 Jan 2010 21:44:27 +0300 Received: by rain (nbSMTP-1.00) for uid 1000 dushistov@mail.ru; Thu, 28 Jan 2010 21:44:46 +0300 (MSK) Date: Thu, 28 Jan 2010 21:44:46 +0300 From: Evgeniy Dushistov To: qemu-devel@nongnu.org Message-ID: <20100128184446.GA21065@rain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: Not detected X-Mras: Ok X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /dev/tty) 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 In case, when qemu is executed with option like -serial /dev/ttyS0, report if there are problems with opening of devices. At now errors are silently ignoring. Signed-off-by: Evgeniy Dushistov --- qemu-char.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 800ee6c..75dbf66 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1180,6 +1180,9 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts *opts) int fd; TFR(fd = open(filename, O_RDWR | O_NONBLOCK)); + if (fd < 0) { + return NULL; + } tty_serial_init(fd, 115200, 'N', 8, 1); chr = qemu_chr_open_fd(fd, fd); if (!chr) {