Skip to contentSkip to conversation

selftests/landlock: Fix build of audit_test

PATCH In review Song Liu 2 participants 2 messages Jun 5, 2025 – Jun 6, 2025

Subsystems (3)
lore
Share & tools
lore

Song Liu

author
#0 lore raw

PATCH 1/1 selftests/landlock: Fix build of audit_test

We are hitting build error on CentOS 9:

audit_test.c:232:40: error: ‘O_CLOEXEC’ undeclared (...)

Fix this by including fcntl.h.

---
 tools/testing/selftests/landlock/audit_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/landlock/audit_test.c +1 -0
index cfc571afd0eb..46d02d49835a 100644
@@ -7,6 +7,7 @@
 
 #define _GNU_SOURCE
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <linux/landlock.h>
 #include <pthread.h>
Signature · 1 line
2.47.1
maintainer
#1 lore raw
Quoted 7 lines · Song Liu

We are hitting build error on CentOS 9:

audit_test.c:232:40: error: ‘O_CLOEXEC’ undeclared (...)

Fix this by including fcntl.h.

Thanks, I'll merge it in my tree.

Quoted 20 lines
---
 tools/testing/selftests/landlock/audit_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/landlock/audit_test.c +1 -0
index cfc571afd0eb..46d02d49835a 100644
@@ -7,6 +7,7 @@
 
 #define _GNU_SOURCE
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <linux/landlock.h>
 #include <pthread.h>
Signature · 1 line
2.47.1