save the old errno of the sendfile() call in case that the attr_get()

fails in stat-cache-get-entry 


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1386 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.13
Jan Kneschke 2006-10-08 18:24:14 +00:00
parent d6bfa8aaa8
commit a0aafd9a24
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}