Style: changing preprocessor directives.
Using #if directives instead of #ifdef the same way as in other places.
This commit is contained in:
@@ -246,24 +246,30 @@ nxt_sendfile(int fd, int s, off_t pos, size_t size)
|
|||||||
{
|
{
|
||||||
ssize_t res;
|
ssize_t res;
|
||||||
|
|
||||||
#ifdef NXT_HAVE_MACOSX_SENDFILE
|
#if (NXT_HAVE_MACOSX_SENDFILE)
|
||||||
|
|
||||||
off_t sent = size;
|
off_t sent = size;
|
||||||
|
|
||||||
int rc = sendfile(fd, s, pos, &sent, NULL, 0);
|
int rc = sendfile(fd, s, pos, &sent, NULL, 0);
|
||||||
|
|
||||||
res = (rc == 0 || sent > 0) ? sent : -1;
|
res = (rc == 0 || sent > 0) ? sent : -1;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NXT_HAVE_FREEBSD_SENDFILE
|
#elif (NXT_HAVE_FREEBSD_SENDFILE)
|
||||||
|
|
||||||
off_t sent = 0;
|
off_t sent = 0;
|
||||||
|
|
||||||
int rc = sendfile(fd, s, pos, size, NULL, &sent, 0);
|
int rc = sendfile(fd, s, pos, size, NULL, &sent, 0);
|
||||||
|
|
||||||
res = (rc == 0 || sent > 0) ? sent : -1;
|
res = (rc == 0 || sent > 0) ? sent : -1;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NXT_HAVE_LINUX_SENDFILE
|
#elif (NXT_HAVE_LINUX_SENDFILE)
|
||||||
|
|
||||||
res = sendfile(s, fd, &pos, size);
|
res = sendfile(s, fd, &pos, size);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
res = -1;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user