summaryrefslogtreecommitdiffstats
path: root/tests/elfstrtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/elfstrtab.c')
-rw-r--r--tests/elfstrtab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/elfstrtab.c b/tests/elfstrtab.c
index c27d6cfb..69ba46b4 100644
--- a/tests/elfstrtab.c
+++ b/tests/elfstrtab.c
@@ -134,7 +134,7 @@ check_elf (const char *fname, int class, int use_mmap)
printf ("\nfname: %s\n", fname);
stridx = 0;
- int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ int fd = open (fname, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, 0666);
if (fd == -1)
{
printf ("cannot open `%s': %s\n", fname, strerror (errno));
@@ -280,7 +280,7 @@ check_elf (const char *fname, int class, int use_mmap)
close (fd);
/* Read the ELF from disk now. */
- fd = open (fname, O_RDWR, 0666);
+ fd = open (fname, O_RDWR | O_BINARY, 0666);
if (fd == -1)
{
printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));
@@ -349,7 +349,7 @@ check_elf (const char *fname, int class, int use_mmap)
close (fd);
// And read it in one last time.
- fd = open (fname, O_RDONLY, 0666);
+ fd = open (fname, O_RDONLY | O_BINARY, 0666);
if (fd == -1)
{
printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));