aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2024-03-28 14:42:03 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2024-05-05 09:42:32 +0200
commit17f21cccaab68de21a97d8a02f5259934b4498d4 (patch)
treec382ed7cb376b0bb2633cdc7bd3b24a90ffbc8d0
parent6cc9548518b35487f88538f79d603e6726c62d17 (diff)
downloadtcpdump-17f21cccaab68de21a97d8a02f5259934b4498d4.tar.gz
Include <fcntl.h> unconditionally
It is used for open() which is in POSIX.1-2001, POSIX.1-2008. libpcap has included <fcntl.h> unconditionally since at least 1999. (cherry picked from commit f81ffd175499bf3252594d90932c553ea668765b)
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmakeconfig.h.in3
-rw-r--r--configure.ac2
-rw-r--r--tcpdump.c2
4 files changed, 1 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c890611..767379ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -344,7 +344,6 @@ cmake_pop_check_state()
#
# Header files.
#
-check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(rpc/rpc.h HAVE_RPC_RPC_H)
check_include_file(net/if.h HAVE_NET_IF_H)
if(HAVE_RPC_RPC_H)
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index fb9d2431..58f7e30f 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -39,9 +39,6 @@
/* Define to 1 if you have the `EVP_DecryptInit_ex' function. */
#cmakedefine HAVE_EVP_DECRYPTINIT_EX 1
-/* Define to 1 if you have the <fcntl.h> header file. */
-#cmakedefine HAVE_FCNTL_H 1
-
/* Define to 1 if you have the `fork' function. */
#cmakedefine HAVE_FORK 1
diff --git a/configure.ac b/configure.ac
index 476ed5c4..0bd1577a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ fi
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
-AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h net/if.h)
+AC_CHECK_HEADERS(rpc/rpc.h rpc/rpcent.h net/if.h)
#
# Get the size of a void *, to know whether this is a 32-bit or 64-bit build.
#
diff --git a/tcpdump.c b/tcpdump.c
index adb5d469..b3e9fc38 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -63,9 +63,7 @@ The Regents of the University of California. All rights reserved.\n";
#include <sys/stat.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
#ifdef HAVE_LIBCRYPTO
#include <openssl/crypto.h>