Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4942957
hivex_o_binary.patch
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Referenced Files
None
Subscribers
None
hivex_o_binary.patch
View Options
From 726feff722dbaee93064ffc603d9979c26399928 Mon Sep 17 00:00:00 2001
From: Gillen Daniel <gillen.daniel@gmail.com>
Date: Thu, 27 Jun 2013 23:08:15 +0200
Subject: [PATCH] hivex: Add O_BINARY flag to open calls for platforms where
this isn't the default (such as Win32)
---
lib/hivex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c
index 040b1e7..86e5959 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -265,9 +265,9 @@ hivex_open (const char *filename, int flags)
goto error;
#ifdef O_CLOEXEC
- h->fd = open (filename, O_RDONLY | O_CLOEXEC);
+ h->fd = open (filename, O_RDONLY | O_CLOEXEC | O_BINARY);
#else
- h->fd = open (filename, O_RDONLY);
+ h->fd = open (filename, O_RDONLY | O_BINARY);
#endif
if (h->fd == -1)
goto error;
@@ -2261,7 +2261,7 @@ hivex_commit (hive_h *h, const char *filename, int flags)
}
filename = filename ? : h->filename;
- int fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, 0666);
+ int fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_BINARY, 0666);
if (fd == -1)
return -1;
--
1.7.10.4
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jun 3, 9:02 AM (12 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1257775
Default Alt Text
hivex_o_binary.patch (1 KB)
Attached To
Mode
rFRED fred
Attached
Detach File
Event Timeline
Log In to Comment