aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-01-24 16:14:39 +0000
committerBlue Swirl <blauwirbel@gmail.com>2013-01-26 13:27:16 +0000
commit390999910bf1b1be59e04a0314867f4dea7a28f3 (patch)
treec6cd668a0195549a7dfc26e75da12a8c05a3e2b1
parent23bf49b5eca716aaad073f2b47613434e1515cb5 (diff)
downloadqemu-390999910bf1b1be59e04a0314867f4dea7a28f3.zip
qemu-390999910bf1b1be59e04a0314867f4dea7a28f3.tar.gz
qemu-390999910bf1b1be59e04a0314867f4dea7a28f3.tar.bz2
qemu-char: Avoid unused variable warning in some configs
Avoid unused variable warnings: qemu-char.c: In function 'qmp_chardev_open_port': qemu-char.c:3132: warning: unused variable 'fd' qemu-char.c:3132: warning: unused variable 'flags' in configurations with neither HAVE_CHARDEV_TTY nor HAVE_CHARDEV_PARPORT set. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--qemu-char.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 9ba0573..da1db1d 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3129,11 +3129,11 @@ static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)
static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error **errp)
{
- int flags, fd;
-
switch (port->type) {
#ifdef HAVE_CHARDEV_TTY
case CHARDEV_PORT_KIND_SERIAL:
+ {
+ int flags, fd;
flags = O_RDWR;
fd = qmp_chardev_open_file_source(port->device, flags, errp);
if (error_is_set(errp)) {
@@ -3141,15 +3141,19 @@ static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error **errp)
}
socket_set_nonblock(fd);
return qemu_chr_open_tty_fd(fd);
+ }
#endif
#ifdef HAVE_CHARDEV_PARPORT
case CHARDEV_PORT_KIND_PARALLEL:
+ {
+ int flags, fd;
flags = O_RDWR;
fd = qmp_chardev_open_file_source(port->device, flags, errp);
if (error_is_set(errp)) {
return NULL;
}
return qemu_chr_open_pp_fd(fd);
+ }
#endif
default:
error_setg(errp, "unknown chardev port (%d)", port->type);