Patchwork [2/9] rng-random: use error_setg_file_open()

login
register
mail settings
Submitter Luiz Capitulino
Date June 7, 2013, 7:52 p.m.
Message ID <1370634755-18132-3-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/249802/
State New
Headers show

Comments

Luiz Capitulino - June 7, 2013, 7:52 p.m.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 backends/rng-random.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 830360c..68dfc8a 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);
         }
     }
 }