[PATCH v2 03/13] selftests/filesystems: fclog: Fix build warnings and errors

From: Guenter Roeck

Date: Fri Dec 05 2025 - 12:12:18 EST


Fix

fclog.c:37:21: warning: call to undeclared function 'open'
fclog.c:37:47: error: use of undeclared identifier 'O_RDONLY'; did you mean 'MS_RDONLY'?
fclog.c:37:56: error: use of undeclared identifier 'O_CLOEXEC'

by including fcntl.h.

Fixes: df579e471111b ("selftests/filesystems: add basic fscontext log tests")
Cc: Aleksa Sarai <cyphar@xxxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
v2: Update subject and description to reflect that the patch also fixes
build warnings.

tools/testing/selftests/filesystems/fclog.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/filesystems/fclog.c b/tools/testing/selftests/filesystems/fclog.c
index 912a8b755c3b..d7cc3aaa8672 100644
--- a/tools/testing/selftests/filesystems/fclog.c
+++ b/tools/testing/selftests/filesystems/fclog.c
@@ -6,6 +6,7 @@

#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
--
2.45.2