Skip to content

Commit

Permalink
Fix sendfile in MACOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Nov 20, 2018
1 parent d043e9d commit 60023b7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/os/sendfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

int swoole_sendfile(int out_fd, int in_fd, off_t *offset, size_t size)
{
off_t sent_bytes = 0;
int ret;

#ifdef __MACH__
Expand All @@ -47,18 +46,13 @@ int swoole_sendfile(int out_fd, int in_fd, off_t *offset, size_t size)
*offset += size;
if (ret == -1)
{
if (errno == EAGAIN)
{
*offset += sent_bytes;
return sent_bytes;
}
else if (errno == EINTR)
if (errno == EINTR)
{
goto do_sendfile;
}
else
{
return SW_ERR;
return ret;
}
}
else if (ret == 0)
Expand Down

0 comments on commit 60023b7

Please sign in to comment.