Skip to content

Commit

Permalink
Fix build on systems without sendfile(2).
Browse files Browse the repository at this point in the history
Tested on:	OpenBSD 5.4
  • Loading branch information
bmah888 committed Apr 15, 2014
1 parent de54235 commit 9ac254d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ Nsendfile(int fromfd, int tofd, const char *buf, size_t count)
#endif
#endif
#endif
#endif /* HAVE_SENDFILE */
if (r < 0) {
switch (errno) {
case EINTR:
Expand All @@ -287,6 +286,10 @@ Nsendfile(int fromfd, int tofd, const char *buf, size_t count)
nleft -= r;
}
return count;
#else /* HAVE_SENDFILE */
errno = ENOSYS; /* error if somehow get called without HAVE_SENDFILE */
return -1;
#endif /* HAVE_SENDFILE */
}

/*************************************************************************/
Expand Down

0 comments on commit 9ac254d

Please sign in to comment.