Bug #2073
closedwrong position for #include <sys/types.h> in network_backends.h
Description
Hello everybody,
I use lighttpd with linux 2.6 on a embedded plattform.
Compiling network.c, <sys/type.h> are included bevore "config.h", so _GNU_SOURCE is not defined for <sys/types.h>. Compiling network_linux_sendfile.c, <sys/types.h> is included after "config.h" and _GNU_SOURCE is defined. The problem for my system, I do not use large file support (configure ... --enable-lfs=no), but I do use linux_sendfile, (but not sendfile64). If _GNU_SOURCE is defiend in <sys/types.h>, from features.h you will get _LARGEFILE_SOURCE defiend.
In network_backend.h:
[...]
#if defined HAVE_SYS_SENDFILE_H && defined HAVE_SENDFILE && (!defined _LARGEFILE_SOURCE || defined HAVE_SENDFILE64) && defined HAVE_WRITEV && defined(linux) && !defined HAVE_SENDFILE_BROKEN- define USE_LINUX_SENDFILE
- include <sys/sendfile.h>
- include <sys/uio.h>
#endif
[ ... ]
In network.c HAVE_SENDFILE_LINUX is defiend and in network_linux_sendfile.c it is not, so the function network_write_chunkqueue_linuxsendfile is not compiled, I get unresolved errors of course. The solution for me was to move #include <sys/types.h> in fornt of #include "config.h".
Regards, Markus
Files
Updated by stbuehler about 9 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Also available in: Atom