]> 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)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 5 May 2024 07:42:32 +0000 (09:42 +0200)
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)

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

index 9c89061114d5d238302c558a506f6332811d5199..767379abcf3c7cf06d178b8a2b6fbdfdbb6d1918 100644 (file)
@@ -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)
index fb9d24312497e508debbbea99027e47a03ad8a3a..58f7e30f5ff5301dfb667badce7d78e514611c25 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 476ed5c40876d3c03459405124d2f6ac200fbaa5..0bd1577a26a0c2d9339eec42cbab9d27fbd2a24d 100644 (file)
@@ -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.
 #
index adb5d4697368e576aae22c2b931090dedae7c476..b3e9fc387fe587c2bb7839a20d45371d6e0b3160 100644 (file)
--- 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>