summaryrefslogtreecommitdiffstats
path: root/tests/fillfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fillfile.c')
-rw-r--r--tests/fillfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/fillfile.c b/tests/fillfile.c
index 915e249d..4529637b 100644
--- a/tests/fillfile.c
+++ b/tests/fillfile.c
@@ -201,7 +201,7 @@ check_elf (const char *fname, int class, int use_mmap)
printf ("\nfname: %s\n", fname);
stridx = 0; // Reset strtab strings index
- int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0666);
if (fd == -1)
{
printf ("cannot open `%s': %s\n", fname, strerror (errno));
@@ -266,7 +266,7 @@ check_elf (const char *fname, int class, int use_mmap)
/* Reread the ELF from disk now. */
printf ("Rereading %s\n", fname);
- fd = open (fname, O_RDWR, 0666);
+ fd = open (fname, O_RDWR | O_BINARY, 0666);
if (fd == -1)
{
printf ("cannot (re)open `%s': %s\n", fname, strerror (errno));
@@ -347,7 +347,7 @@ check_elf (const char *fname, int class, int use_mmap)
// And read it in one last time.
printf ("Rereading %s again\n", fname);
- 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));