From: Viktor Szakats Date: Tue, 30 Sep 2025 16:17:52 +0000 (+0200) Subject: tidy-up: `fcntl.h` includes X-Git-Tag: rc-8_17_0-1~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f97aa8d7ed029ee99e097d9b0c9bd01570574478;p=thirdparty%2Fcurl.git tidy-up: `fcntl.h` includes - drop from source files without obvious users. - include in `curlx/fopen.h` also for Windows. Follow-up to 9678ff5b1bfea1c847aee4f9edf023e8f01c9293 #18776 Closes #18782 --- diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 0a1364e4b3..897b968114 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -41,9 +41,6 @@ #ifdef HAVE_NETDB_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef HAVE_ARPA_INET_H #include #endif diff --git a/lib/cf-socket.c b/lib/cf-socket.c index d5add9723f..cdd496a5e1 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -44,9 +44,6 @@ #ifdef HAVE_NETDB_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef HAVE_ARPA_INET_H #include #endif diff --git a/lib/connect.c b/lib/connect.c index 1182a42d31..4f42fef0e8 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -41,9 +41,6 @@ #ifdef HAVE_NETDB_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef HAVE_ARPA_INET_H #include #endif diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index d1e3d127c5..b44cbbdfce 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -28,6 +28,10 @@ #include "multibyte.h" +#ifdef HAVE_FCNTL_H +#include /* for open() and attributes */ +#endif + #if defined(_WIN32) && !defined(UNDER_CE) FILE *curlx_win32_fopen(const char *filename, const char *mode); int curlx_win32_stat(const char *path, struct_stat *buffer); @@ -36,9 +40,6 @@ int curlx_win32_open(const char *filename, int oflag, ...); #define curlx_stat(fname, stp) curlx_win32_stat(fname, stp) #define curlx_open curlx_win32_open #else -#ifdef HAVE_FCNTL_H -#include /* for open() */ -#endif #define CURLX_FOPEN_LOW fopen #define curlx_stat(fname, stp) stat(fname, stp) #define curlx_open open diff --git a/lib/rand.c b/lib/rand.c index f30f3de7c3..8b7f07ae40 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -26,9 +26,6 @@ #include -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef HAVE_ARPA_INET_H #include #endif diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 9e3870e470..1b1f66cc6e 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -43,9 +43,6 @@ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #include "../urldata.h" #include "../cfilters.h" diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 662539cd89..e934fa3b5e 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -29,9 +29,6 @@ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #include "../urldata.h" #include "../cfilters.h"