diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/baum.c | 10 | ||||
-rw-r--r-- | backends/msmouse.c | 10 | ||||
-rw-r--r-- | backends/rng-random.c | 4 |
3 files changed, 18 insertions, 6 deletions
diff --git a/backends/baum.c b/backends/baum.c index 37ccca8211..9063aea2cf 100644 --- a/backends/baum.c +++ b/backends/baum.c @@ -25,7 +25,6 @@ #include "char/char.h" #include "qemu/timer.h" #include "hw/usb.h" -#include "char/baum.h" #include <brlapi.h> #include <brlapi_constants.h> #include <brlapi_keycodes.h> @@ -562,7 +561,7 @@ static void baum_close(struct CharDriverState *chr) g_free(baum); } -CharDriverState *chr_baum_init(QemuOpts *opts) +static CharDriverState *chr_baum_init(QemuOpts *opts) { BaumDriverState *baum; CharDriverState *chr; @@ -625,3 +624,10 @@ fail_handle: g_free(baum); return NULL; } + +static void register_types(void) +{ + register_char_driver("braille", chr_baum_init); +} + +type_init(register_types); diff --git a/backends/msmouse.c b/backends/msmouse.c index bf2ff2aca8..407ec87784 100644 --- a/backends/msmouse.c +++ b/backends/msmouse.c @@ -25,7 +25,6 @@ #include "qemu-common.h" #include "char/char.h" #include "ui/console.h" -#include "char/msmouse.h" #define MSMOUSE_LO6(n) ((n) & 0x3f) #define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6) @@ -64,7 +63,7 @@ static void msmouse_chr_close (struct CharDriverState *chr) g_free (chr); } -CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) +static CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) { CharDriverState *chr; @@ -76,3 +75,10 @@ CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) return chr; } + +static void register_types(void) +{ + register_char_driver("msmouse", qemu_chr_open_msmouse); +} + +type_init(register_types); diff --git a/backends/rng-random.c b/backends/rng-random.c index 0d1108811d..acd20afad2 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -74,7 +74,7 @@ static void rng_random_opened(RngBackend *b, Error **errp) error_set(errp, QERR_INVALID_PARAMETER_VALUE, "filename", "a valid filename"); } else { - s->fd = open(s->filename, O_RDONLY | O_NONBLOCK); + s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK); if (s->fd == -1) { error_set(errp, QERR_OPEN_FILE_FAILED, s->filename); @@ -130,7 +130,7 @@ static void rng_random_finalize(Object *obj) qemu_set_fd_handler(s->fd, NULL, NULL, NULL); if (s->fd != -1) { - close(s->fd); + qemu_close(s->fd); } g_free(s->filename); |