qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /


From: Evgeniy Dushistov
Subject: [Qemu-devel] [PATCH] Do not ignore error, if open file failed (-serial /dev/tty)
Date: Thu, 28 Jan 2010 21:44:46 +0300
User-agent: Mutt/1.5.20 (2009-06-14)

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 <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]