qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 2/4] acpitable: open the data file in binary mode
Date: Mon, 21 Jan 2013 11:59:41 +0100	[thread overview]
Message-ID: <1358765983-30201-3-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1358765983-30201-1-git-send-email-stefanha@redhat.com>

From: Michael Tokarev <mjt@tls.msk.ru>

-acpitable {file|data}=file reads the content of file, but it is
in binary form, so the file should be opened usin O_BINARY flag.
On *nix it is a no-op, but on windows and other weird platform
it is really needed.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/acpi.c b/hw/acpi.c
index 97617c4..8c9dcc5 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -104,7 +104,7 @@ int acpi_table_add(const char *t)
     /* now read in the data files, reallocating buffer as needed */
 
     for (f = strtok(buf, ":"); f; f = strtok(NULL, ":")) {
-        int fd = open(f, O_RDONLY);
+        int fd = open(f, O_RDONLY | O_BINARY);
 
         if (fd < 0) {
             fprintf(stderr, "can't open file %s: %s\n", f, strerror(errno));
-- 
1.8.1

  parent reply	other threads:[~2013-01-21 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 10:59 [Qemu-devel] [PULL for-1.4 0/4] Trivial patches for 16 to 21 January 2013 Stefan Hajnoczi
2013-01-21 10:59 ` [Qemu-devel] [PATCH 1/4] hw: Spelling fix in log message Stefan Hajnoczi
2013-01-21 10:59 ` Stefan Hajnoczi [this message]
2013-01-21 10:59 ` [Qemu-devel] [PATCH 3/4] configure: silence pkg-config's check for curses Stefan Hajnoczi
2013-01-21 10:59 ` [Qemu-devel] [PATCH 4/4] hw/tpci200: Fix compiler warning (redefined symbol with MinGW) 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=1358765983-30201-3-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@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).