aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2010-01-28 21:44:46 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-10 11:56:56 -0600
commitafc535acb579a7808d9ff170088c839a29c61dc9 (patch)
tree598e37ea6d5db7bff1bb3e4c4178f06a5c48b0c0
parent20cc99972cea37de519253cb31790045cb0c8604 (diff)
downloadqemu-afc535acb579a7808d9ff170088c839a29c61dc9.zip
qemu-afc535acb579a7808d9ff170088c839a29c61dc9.tar.gz
qemu-afc535acb579a7808d9ff170088c839a29c61dc9.tar.bz2
Do not ignore error, if open file failed (-serial /dev/tty)
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--qemu-char.c3
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) {