Skip to contentSkip to conversation

tests/inet_socket/connect.c: add missing include for bool

PATCH In review Ondrej Mosnacek 2 participants 3 messages Aug 3 – Aug 4 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/inet_socket/connect.c: add missing include for bool

The below commit added a usage of the bool type to tests/inet_socket/connect.c, but didn't add the corresponding stdlib include (<stdbool.h>). This problem seems to be masked on Fedora (likely some other header file includes <stdbool.h> internally), but for example on CentOS 10 or 9 the compilation fails because of it.

Fix it by adding the missing include.

Fixes 433c597a6a9a ("tests/inet_socket: add tests for TCP Fast Open")
---
 tests/inet_socket/connect.c | 1 +
 1 file changed, 1 insertion(+)
tests/inet_socket/connect.c +1 -0
index 067d196..89e85ef 100644
@@ -3,6 +3,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <string.h>
Signature · 1 line
2.55.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ondrej Mosnacek

The below commit added a usage of the bool type to tests/inet_socket/connect.c, but didn't add the corresponding stdlib include (<stdbool.h>). This problem seems to be masked on Fedora (likely some other header file includes <stdbool.h> internally), but for example on CentOS 10 or 9 the compilation fails because of it.

Fix it by adding the missing include.

Fixes 433c597a6a9a ("tests/inet_socket: add tests for TCP Fast Open")
Quoted 20 lines
---
 tests/inet_socket/connect.c | 1 +
 1 file changed, 1 insertion(+)
tests/inet_socket/connect.c +1 -1
index 067d196..89e85ef 100644
@@ -3,6 +3,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <string.h>
--

2.55.0

#2 lore raw
Quoted 20 lines · Stephen Smalley
Quoted 11 lines · Ondrej Mosnacek

The below commit added a usage of the bool type to tests/inet_socket/connect.c, but didn't add the corresponding stdlib include (<stdbool.h>). This problem seems to be masked on Fedora (likely some other header file includes <stdbool.h> internally), but for example on CentOS 10 or 9 the compilation fails because of it.

Fix it by adding the missing include.

Fixes 433c597a6a9a ("tests/inet_socket: add tests for TCP Fast Open")
Quoted 4 lines
---
 tests/inet_socket/connect.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 17 lines
Quoted 13 lines
tests/inet_socket/connect.c +1 -1
index 067d196..89e85ef 100644
@@ -3,6 +3,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <string.h>
--
Quoted 3 lines

2.55.0

Applied: https://github.com/SELinuxProject/selinux-testsuite/commit/665bcda2e11f18c342653b0f497eee0444962d4b

Signature · 3 lines
Ondrej Mosnacek
Senior Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.