From b9cbd4452f6c93c46084710b0b7af4af232cded3 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 12 Jul 2022 21:15:06 +0200 Subject: [PATCH] Fix compiling for Android Compiler complains error: 'open' has superfluous mode bits; missing O_CREAT? --- tests/test_util_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_util_file.c b/tests/test_util_file.c index d0cb8a1..db2dbcf 100644 --- a/tests/test_util_file.c +++ b/tests/test_util_file.c @@ -93,7 +93,7 @@ static void test_write_to_file() static void stat_and_cat(const char *file) { struct stat sb; - int d = open(file, O_RDONLY, 0600); + int d = open(file, O_CREAT | O_RDONLY, 0600); if (d < 0) { printf("FAIL: unable to open %s: %s\n", file, strerror(errno));