diff options
Diffstat (limited to 'src/network_linux_sendfile.c')
-rw-r--r-- | src/network_linux_sendfile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network_linux_sendfile.c b/src/network_linux_sendfile.c index d49263d..6586efb 100644 --- a/src/network_linux_sendfile.c +++ b/src/network_linux_sendfile.c @@ -175,6 +175,7 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, } if (r == 0) { + int oerrno = errno; /* We got an event to write but we wrote nothing * * - the file shrinked -> error @@ -187,9 +188,12 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, if (offset > sce->st.st_size) { /* file shrinked, close the connection */ + errno = oerrno; + return -1; } + errno = oerrno; return -2; } |