diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2010-01-28 21:44:46 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-10 11:56:56 -0600 |
commit | afc535acb579a7808d9ff170088c839a29c61dc9 (patch) | |
tree | 598e37ea6d5db7bff1bb3e4c4178f06a5c48b0c0 /qemu-char.c | |
parent | 20cc99972cea37de519253cb31790045cb0c8604 (diff) |
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>
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |