summaryrefslogtreecommitdiff
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-23 14:07:57 -0600
commit02510b24368f76b5e8eb3edbca880d177869f265 (patch)
tree72ce23ce23bf4f37d3746728f97d44f8399f8d24
parentb57a2297f2a24471d5ddb651578867fb5399b540 (diff)
downloadqemu-02510b24368f76b5e8eb3edbca880d177869f265.tar.gz
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> (cherry picked from commit afc535acb579a7808d9ff170088c839a29c61dc9)
-rw-r--r--qemu-char.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c
index b13f8d4cf7..5a1b535bdc 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) {