config.mk: improve feature test macros and compatibility
- add missing header netinet/in.h for socket declarations (POSIX). - rename sendfile to responsefile, sendfile(2) is a syscall on FreeBSD. - remove _XOPEN_SOURCE: this will give a warning about strptime on Linux glibc, but unbreaks the build on NetBSD and FreeBSD. thanks also to josuah and quinq for testing!
This commit is contained in:
parent
7e199ee04d
commit
5defa985db
2 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,7 @@ PREFIX = /usr/local
|
|||
MANPREFIX = $(PREFIX)/share/man
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
|
||||
CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Os
|
||||
LDFLAGS = -s
|
||||
|
||||
|
|
5
quark.c
5
quark.c
|
@ -1,4 +1,5 @@
|
|||
/* See LICENSE file for license details. */
|
||||
#include <netinet/in.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -418,7 +419,7 @@ cleanup:
|
|||
}
|
||||
|
||||
static enum status
|
||||
sendfile(int fd, char *name, struct request *r, struct stat *st, char *mime,
|
||||
responsefile(int fd, char *name, struct request *r, struct stat *st, char *mime,
|
||||
off_t lower, off_t upper)
|
||||
{
|
||||
FILE *fp;
|
||||
|
@ -754,7 +755,7 @@ sendresponse(int fd, struct request *r)
|
|||
}
|
||||
}
|
||||
|
||||
return sendfile(fd, RELPATH(realtarget), r, &st, mime, lower, upper);
|
||||
return responsefile(fd, RELPATH(realtarget), r, &st, mime, lower, upper);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue