summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getalt.c
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2018-07-19 18:36:12 +0200
committerUlf Hermann <[email protected]>2018-07-20 14:45:13 +0000
commit4ef620c1b74d7442c43ddb03da563639d923f0d2 (patch)
tree9d427ff9d1d833c11b4409fdac88bab206119d06 /libdw/dwarf_getalt.c
parent6166020e5f1acc87c3f00f0d2f15f073971be545 (diff)
Add O_BINARY to new open() calls
Windows needs that if you're not reading text. Change-Id: I923782f2c47ef16765f52d6a435f69cb33f50dfd Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'libdw/dwarf_getalt.c')
-rw-r--r--libdw/dwarf_getalt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdw/dwarf_getalt.c b/libdw/dwarf_getalt.c
index 0a12dfae..05624d5d 100644
--- a/libdw/dwarf_getalt.c
+++ b/libdw/dwarf_getalt.c
@@ -133,7 +133,7 @@ find_debug_altlink (Dwarf *dbg)
strcpy (&id_path[sizeof DEBUGINFO_PATH - 1 + sizeof "/.build-id/" - 1
+ 3 + (id_len - 1) * 2], ".debug");
- fd = TEMP_FAILURE_RETRY (open (id_path, O_RDONLY));
+ fd = TEMP_FAILURE_RETRY (open (id_path, O_RDONLY | O_BINARY));
}
/* Fall back on (possible relative) alt file path. */
@@ -142,7 +142,7 @@ find_debug_altlink (Dwarf *dbg)
char *altpath = __libdw_filepath (dbg->debugdir, NULL, altname);
if (altpath != NULL)
{
- fd = TEMP_FAILURE_RETRY (open (altpath, O_RDONLY));
+ fd = TEMP_FAILURE_RETRY (open (altpath, O_RDONLY | O_BINARY));
free (altpath);
}
}