From afc535acb579a7808d9ff170088c839a29c61dc9 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Thu, 28 Jan 2010 21:44:46 +0300 Subject: [PATCH] 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 Signed-off-by: Anthony Liguori --- qemu-char.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index 800ee6c503..75dbf66858 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) { -- 2.11.4.GIT