All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Dushistov <dushistov@mail.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /dev/tty)
Date: Thu, 28 Jan 2010 21:44:46 +0300	[thread overview]
Message-ID: <20100128184446.GA21065@rain> (raw)

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 <dushistov@mail.ru>
---
 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

             reply	other threads:[~2010-01-28 18:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 18:44 Evgeniy Dushistov [this message]
2010-02-10 18:31 ` [Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /dev/tty) Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100128184446.GA21065@rain \
    --to=dushistov@mail.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.