From: Evgeniy Dushistov Date: Thu, 28 Jan 2010 18:44:46 +0000 (+0300) Subject: Do not ignore error, if open file failed (-serial /dev/tty) X-Git-Tag: v0.13.0-rc0~1427 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=afc535acb579a7808d9ff170088c839a29c61dc9;p=thirdparty%2Fqemu.git 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 --- diff --git a/qemu-char.c b/qemu-char.c index 800ee6c503b..75dbf668585 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) {