diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index d3b9958d..fde1703d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -8015,9 +8015,7 @@ MHD_init (void) gnutls_global_init (); #endif /* HTTPS_SUPPORT */ MHD_monotonic_sec_counter_init (); -#ifdef HAVE_FREEBSD_SENDFILE MHD_send_init_static_vars_ (); -#endif /* HAVE_FREEBSD_SENDFILE */ MHD_init_mem_pools_ (); } diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 3810e121..10c95117 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c @@ -82,6 +82,9 @@ static int freebsd_sendfile_flags_; */ static int freebsd_sendfile_flags_thd_p_c_; #endif /* SF_FLAGS */ +#endif /* HAVE_FREEBSD_SENDFILE */ + + /** * Initialises static variables */ @@ -91,6 +94,7 @@ MHD_send_init_static_vars_ (void) /* FreeBSD 11 and later allow to specify read-ahead size * and handles SF_NODISKIO differently. * SF_FLAGS defined only on FreeBSD 11 and later. */ +#ifdef HAVE_FREEBSD_SENDFILE #ifdef SF_FLAGS long sys_page_size = sysconf (_SC_PAGESIZE); if (0 >= sys_page_size) @@ -108,10 +112,8 @@ MHD_send_init_static_vars_ (void) / sys_page_size), SF_NODISKIO); } #endif /* SF_FLAGS */ -} - - #endif /* HAVE_FREEBSD_SENDFILE */ +} bool diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h index d4ee8de7..57f6319b 100644 --- a/src/microhttpd/mhd_send.h +++ b/src/microhttpd/mhd_send.h @@ -46,15 +46,12 @@ #define MHD_VECT_SEND 1 #endif /* HAVE_SENDMSG || HAVE_WRITEV || MHD_WINSOCK_SOCKETS */ -#ifdef HAVE_FREEBSD_SENDFILE /** * Initialises static variables */ void MHD_send_init_static_vars_ (void); -#endif /* HAVE_FREEBSD_SENDFILE */ - /** * Send buffer to the client, push data from network buffer if requested