From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxF6e-0004um-2g for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:00:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxF6Y-0006zR-J3 for qemu-devel@nongnu.org; Mon, 21 Jan 2013 05:59:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxF6Y-0006zN-BK for qemu-devel@nongnu.org; Mon, 21 Jan 2013 05:59:54 -0500 From: Stefan Hajnoczi Date: Mon, 21 Jan 2013 11:59:41 +0100 Message-Id: <1358765983-30201-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1358765983-30201-1-git-send-email-stefanha@redhat.com> References: <1358765983-30201-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] acpitable: open the data file in binary mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Michael Tokarev , Stefan Hajnoczi From: Michael Tokarev -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 Signed-off-by: Stefan Hajnoczi --- 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