Project

General

Profile

Actions

Bug #2073

closed

wrong position for #include <sys/types.h> in network_backends.h

Added by makoe over 15 years ago. Updated about 9 years ago.

Status:
Fixed
Priority:
Low
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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
  1. define USE_LINUX_SENDFILE
  2. include <sys/sendfile.h>
  3. 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

#5

Updated by stbuehler about 9 years ago

  • Target version set to 1.4.40
#6

Updated by stbuehler about 9 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom