Ticket #13468: varnish-darwin9.diff

File varnish-darwin9.diff, 843 bytes (added by pmq@…, 16 years ago)

Tentative patch for Darwin9

  • bin/varnishd/cache_pool.c

     
    3535#include <sys/uio.h>
    3636
    3737#ifdef HAVE_SENDFILE
    38 #if defined(__FreeBSD__)
     38#if defined(__FreeBSD__) || defined(__APPLE__)
    3939#include <sys/socket.h>
    4040#elif defined(__linux__)
    4141#include <sys/sendfile.h>
     
    151151        assert(fd >= 0);
    152152        assert(len > 0);
    153153
    154 #if defined(__FreeBSD__)
     154#if defined(__FreeBSD__) || defined(__APPLE__)
    155155        do {
    156156                struct sf_hdtr sfh;
    157157                memset(&sfh, 0, sizeof sfh);
     
    159159                        sfh.headers = w->iov;
    160160                        sfh.hdr_cnt = w->niov;
    161161                }
    162                 if (sendfile(fd, *w->wfd, off, len, &sfh, NULL, 0) != 0)
     162                if (sendfile(fd, *w->wfd, off, len, &sfh, 0) != 0)
    163163                        w->werr++;
    164164                w->liov = 0;
    165165                w->niov = 0;