diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_config.h | 9 | ||||
-rw-r--r-- | src/core/ngx_sendfile.c | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h index cc650c1f0..2582ddae3 100644 --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -107,6 +107,7 @@ #define HAVE_INHERITED_NONBLOCK 1 #endif +/* FreeBSD sendfile */ #if __FreeBSD_version >= 300007 #ifndef HAVE_FREEBSD_SENDFILE @@ -117,8 +118,9 @@ #define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2 #endif -#endif +#endif /* FreeBSD sendfile */ +/* FreeBSD sendfile nbytes bug */ #if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \ || __FreeBSD_version == 460001 || __FreeBSD_version >= 500029 @@ -127,13 +129,14 @@ #define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0 #endif -#endif +#endif /* FreeBSD sendfile nbytes bug */ #if (HAVE_FREEBSD_SENDFILE) #define HAVE_SENDFILE 1 #endif +/* FreeBSD kqueue */ #if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \ || __FreeBSD_version >= 500011 @@ -142,7 +145,7 @@ #include <sys/event.h> #endif -#endif +#endif /* FreeBSD kqueue */ #endif /* __FreeBSD__ */ diff --git a/src/core/ngx_sendfile.c b/src/core/ngx_sendfile.c index bffd29c0c..e930fe53b 100644 --- a/src/core/ngx_sendfile.c +++ b/src/core/ngx_sendfile.c @@ -1,5 +1,8 @@ #include <ngx_config.h> + +#if !(HAVE_SENDFILE) + #include <ngx_core.h> #include <ngx_log.h> #include <ngx_socket.h> @@ -18,3 +21,5 @@ int ngx_sendfile(ngx_socket_t s, return NGX_ERROR; } + +#endif |