[dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef

Stephen Hemminger stephen at networkplumber.org
Fri Nov 8 19:00:35 CET 2019


The #ifdef to conditionally include <sys/socket.h> on BSD
is unnecessary. It is harmless to include the header on other
OS's. An extra include is better than an #ifdef.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 app/test-pmd/cmdline.c                    | 2 --
 app/test/test_cmdline_ipaddr.c            | 2 --
 lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 74e02d68130f..4e5b3afd0916 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -11,9 +11,7 @@
 #include <termios.h>
 #include <unistd.h>
 #include <inttypes.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 #include <netinet/in.h>
 
 #include <sys/queue.h>
diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
index 315ac3a9f8af..088cd5afc3ad 100644
--- a/app/test/test_cmdline_ipaddr.c
+++ b/app/test/test_cmdline_ipaddr.c
@@ -6,9 +6,7 @@
 #include <string.h>
 #include <inttypes.h>
 #include <netinet/in.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 
 #include <rte_string_fns.h>
 
diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
index 4de5ba35aecc..f8dbdf204c29 100644
--- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
+++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
@@ -13,9 +13,7 @@
 #include <errno.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 
 #include <rte_string_fns.h>
 
-- 
2.20.1



More information about the dev mailing list