From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Thu, 28 Jan 2010 21:44:46 +0300 From: Evgeniy Dushistov Message-ID: <20100128184446.GA21065@rain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /dev/tty) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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) { -- 1.6.5.6 -- /Evgeniy