Skip to contentSkip to conversation

selftests/filesystems: include <fcntl.h> in wrappers.h

PATCH New Sasha Levin 1 participant 1 message Nov 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/filesystems: include <fcntl.h> in wrappers.h

openat_o_mkdir() in wrappers.h uses O_DIRECTORY, O_CREAT and O_EXCL, but the header doesn't include <fcntl.h>. fscontext_ns_test.c doesn't either, so it no longer builds:

../wrappers.h:116:32: error: 'O_DIRECTORY' undeclared

Include it in the header.

---
Every selftest that includes wrappers.h builds with this, gcc and clang on x86_64.

 tools/testing/selftests/filesystems/wrappers.h | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/filesystems/wrappers.h +1 -0
index bc58bdb800631..09f02f67487c6 100644
@@ -5,6 +5,7 @@
 
 #define _GNU_SOURCE
 
+#include <fcntl.h>
 #include <linux/types.h>
 #include <linux/mount.h>
 #include <sys/syscall.h>

base-commit: 13419eff849a88a276dec97fa62a532dc7fff400

Signature · 1 line
2.53.0