From 3e5d9afa4e790e0e71c5fea854ab52372c9023dc Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla@gmail.com>
Date: Mon, 10 May 2010 16:52:02 -0300
Subject: [PATCH] Open files in binary mode.

---
 manifest.c |    2 +-
 util.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/manifest.c b/manifest.c
index 9e2a192..2ab915c 100644
--- a/manifest.c
+++ b/manifest.c
@@ -546,7 +546,7 @@ struct file_hash *manifest_get(const char *manifest_path)
 	uint32_t i;
 	struct file_hash *fh = NULL;
 
-	fd = open(manifest_path, O_RDONLY);
+	fd = open(manifest_path, O_RDONLY | O_BINARY);
 	if (fd == -1) {
 		/* Cache miss. */
 		goto out;
diff --git a/util.c b/util.c
index eca5035..ab664ad 100644
--- a/util.c
+++ b/util.c
@@ -193,7 +193,7 @@ int copy_file(const char *src, const char *dest, int compress_dest)
 	       src, dest, compress_dest ? "compressed": "uncompressed");
 
 	/* open source file */
-	fd_in = open(src, O_RDONLY);
+	fd_in = open(src, O_RDONLY | O_BINARY);
 	if (fd_in == -1) {
 		cc_log("open error: %s", strerror(errno));
 		return -1;
-- 
1.6.0.4

