libs/nixio: fix compile on OS X

This commit is contained in:
Jo-Philipp Wich 2009-12-28 22:03:42 +00:00
parent 0ddedc638c
commit 6ffdb72a4d
2 changed files with 11 additions and 1 deletions

View file

@ -10,8 +10,14 @@ AXTLS_VERSION = 1.2.1
AXTLS_DIR = axTLS
AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
NIXIO_TLS ?= openssl
NIXIO_LDFLAGS = -lcrypt
NIXIO_SO = nixio.so
NIXIO_LDFLAGS =
ifeq (,$(findstring Darwin,$(OS)))
NIXIO_LDFLAGS += -lcrypt
else
EXTRA_CFLAGS += -D__DARWIN__
endif
NIXIO_OBJ = src/nixio.o src/socket.o src/sockopt.o src/bind.o src/address.o \
src/poll.o src/io.o src/file.o src/splice.o src/process.o src/syslog.o \

View file

@ -143,7 +143,11 @@ static int nixio_sendfile(lua_State *L) {
const off_t offset = lseek(infd, 0, SEEK_CUR);
do {
#ifdef __DARWIN__
r = sendfile(infd, sock, offset, len, NULL, 0);
#else
r = sendfile(infd, sock, offset, len, NULL, &spliced, 0);
#endif
} while (r == -1 && errno == EINTR);
if (r == -1) {