summaryrefslogtreecommitdiff
path: root/tests/update2.c
diff options
context:
space:
mode:
authorÉrico Rolim <erico.erc@gmail.com>2020-11-01 22:49:46 -0300
committerMark Wielaard <mark@klomp.org>2020-11-03 15:54:14 +0100
commitced66615bd8c3671c50252cba254fb939b04e362 (patch)
treeb26cee9fe348001db1660cfd464107fcc37765b3 /tests/update2.c
parent95ec1659cdd134a5fd260fffd9e3220909851903 (diff)
downloadelfutils-ced66615bd8c3671c50252cba254fb939b04e362.tar.gz
Switch from numerical to defined constants for permissions.
Use defined constants for permission values. Also add fallback definitions for them in system.h, to allow for compatibility with systems that don't provide these macros. Include system.h in all tests/ files that required it. Signed-off-by: Érico Rolim <erico.erc@gmail.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'tests/update2.c')
-rw-r--r--tests/update2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/update2.c b/tests/update2.c
index 5805163d..71455633 100644
--- a/tests/update2.c
+++ b/tests/update2.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "system.h"
int
@@ -39,7 +40,7 @@ main (int argc, char *argv[] __attribute__ ((unused)))
Elf32_Phdr *phdr;
int i;
- fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, DEFFILEMODE);
if (fd == -1)
{
printf ("cannot open `%s': %s\n", fname, strerror (errno));