qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-trivial@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Eric Blake <eblake@redhat.com>
Subject: [Qemu-trivial] [PATCH] Use qemu_open / qemu_close in rng backend
Date: Fri, 01 Mar 2013 07:53:55 -0500	[thread overview]
Message-ID: <5130A4E3.70003@linux.vnet.ibm.com> (raw)

In the rng backend use qemu_open and qemu_close rather than POSIX 
open/close.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 0d11088..acd20af 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -74,7 +74,7 @@ static void rng_random_opened(RngBackend *b, Error **errp)
          error_set(errp, QERR_INVALID_PARAMETER_VALUE,
                    "filename", "a valid filename");
      } else {
-        s->fd = open(s->filename, O_RDONLY | O_NONBLOCK);
+        s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);

          if (s->fd == -1) {
              error_set(errp, QERR_OPEN_FILE_FAILED, s->filename);
@@ -130,7 +130,7 @@ static void rng_random_finalize(Object *obj)
      qemu_set_fd_handler(s->fd, NULL, NULL, NULL);

      if (s->fd != -1) {
-        close(s->fd);
+        qemu_close(s->fd);
      }

      g_free(s->filename);



             reply	other threads:[~2013-03-01 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 12:53 Stefan Berger [this message]
2013-03-01 13:36 ` [Qemu-trivial] [PATCH] Use qemu_open / qemu_close in rng backend Eric Blake
2013-03-04 10:56 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5130A4E3.70003@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).