From bc5741add11113ee8febdcf33931ec3afe10c729 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 7 Jun 2013 14:28:02 -0400 Subject: rng-random: use error_setg_file_open() Signed-off-by: Luiz Capitulino Acked-by: Kevin Wolf --- backends/rng-random.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'backends/rng-random.c') 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); } } } -- cgit v1.2.3