aboutsummaryrefslogtreecommitdiff
path: root/backends/rng-random.c
diff options
context:
space:
mode:
Diffstat (limited to 'backends/rng-random.c')
-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);
}
}
}