summaryrefslogtreecommitdiff
path: root/tests/fillfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fillfile.c')
-rw-r--r--tests/fillfile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/fillfile.c b/tests/fillfile.c
index 915e249d..7f622536 100644
--- a/tests/fillfile.c
+++ b/tests/fillfile.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "system.h"
#include ELFUTILS_HEADER(elf)
#include <gelf.h>
@@ -201,7 +202,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, DEFFILEMODE);
if (fd == -1)
{
printf ("cannot open `%s': %s\n", fname, strerror (errno));
@@ -266,7 +267,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);
if (fd == -1)
{
printf ("cannot (re)open `%s': %s\n", fname, strerror (errno));
@@ -347,7 +348,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);
if (fd == -1)
{
printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));