aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2013-06-07 14:28:02 -0400
committerLuiz Capitulino <lcapitulino@redhat.com>2013-06-17 11:01:14 -0400
commitbc5741add11113ee8febdcf33931ec3afe10c729 (patch)
tree3798d5d91069e9aee024eeffd04d2d3f8daf8a8f /backends
parent54028d7542cffe97c4685994baac66988c4b7db9 (diff)
rng-random: use error_setg_file_open()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/rng-random.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 830360c780..68dfc8a9c6 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -78,9 +78,8 @@ static void rng_random_opened(RngBackend *b, Error **errp)
"filename", "a valid filename");
} else {
s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);
-
if (s->fd == -1) {
- error_set(errp, QERR_OPEN_FILE_FAILED, s->filename);
+ error_setg_file_open(errp, errno, s->filename);
}
}
}