Skip to content

Commit

Permalink
rng-random: use error_setg_file_open()
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Capitulino <[email protected]>
Acked-by: Kevin Wolf <[email protected]>
  • Loading branch information
Luiz Capitulino committed Jun 17, 2013
1 parent 54028d7 commit bc5741a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backends/rng-random.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit bc5741a

Please sign in to comment.