libs/nixio: fix compile on OS X
[project/luci.git] / libs / nixio / src / splice.c
index 8b4f2a1..4f7c043 100644 (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) {