summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2013-03-01 07:53:55 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-08 13:15:27 +0100
commit7f9c9d12856e65e272297a619705864d9e6346f8 (patch)
treec06af7c5029eb69b4ea078c7abc4fd52a366dc80 /backends
parent358689fe299c306f1d81bea57a5067d0abb56699 (diff)
rng-random: Use qemu_open / qemu_close
In the rng backend use qemu_open and qemu_close rather than POSIX open/close. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/rng-random.c4
1 files changed, 2 insertions, 2 deletions
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);