summaryrefslogtreecommitdiff
path: root/tests/elfstrtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/elfstrtab.c')
-rw-r--r--tests/elfstrtab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/elfstrtab.c b/tests/elfstrtab.c
index c27d6cfb..5fae37e0 100644
--- a/tests/elfstrtab.c
+++ b/tests/elfstrtab.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "system.h"
#include ELFUTILS_HEADER(elf)
#include <gelf.h>
@@ -134,7 +135,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_CREAT | O_TRUNC, DEFFILEMODE);
if (fd == -1)
{
printf ("cannot open `%s': %s\n", fname, strerror (errno));
@@ -280,7 +281,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);
if (fd == -1)
{
printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));
@@ -349,7 +350,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);
if (fd == -1)
{
printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));