]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Include <fcntl.h> unconditionally
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 28 Mar 2024 13:42:03 +0000 (14:42 +0100)
committerfxlb <[email protected]>
Fri, 29 Mar 2024 06:11:55 +0000 (06:11 +0000)
It is used for open() which is in POSIX.1-2001, POSIX.1-2008.

libpcap has included <fcntl.h> unconditionally since at least 1999.

CMakeLists.txt
cmakeconfig.h.in
configure.ac
tcpdump.c

index c331434724c97abc86dc191741146ddcd4395e20..b120511d9cf78a33b32fc0894555ec98239da13a 100644 (file)
@@ -343,7 +343,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)
index b206148ef97de3cee4ff20c35dd8f9a8ebb99b03..0bbf4ecfb827d301684a417825bd3b956e95f2e4 100644 (file)
@@ -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
 
index d36995bfe9635dc3f670f8f68044253e8ae0fdb0..c1bca76362f94491d7c811efc303670f833252e6 100644 (file)
@@ -30,7 +30,7 @@ if test "$ac_cv_prog_cc_c99" = "no"; then
 fi
 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
 
-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.
 #
index 2447678f7ac97e0ed59d1783cb6c9b5f30f2a45f..e4c52c5e4f301890bf14a367a3aab81db7118879 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -61,9 +61,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>