[dovecot-cvs] dovecot/src/lib sendfile-util.c,1.13,1.14

cras at dovecot.org cras at dovecot.org
Thu Jun 8 19:51:13 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv26944

Modified Files:
	sendfile-util.c 
Log Message:
Linux's sendfile() returns 0 when remote has closed connection. Convert it
to EPIPE.



Index: sendfile-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/sendfile-util.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sendfile-util.c	12 Jul 2005 13:06:18 -0000	1.13
+++ sendfile-util.c	8 Jun 2006 16:51:11 -0000	1.14
@@ -51,6 +51,10 @@
 	ret = sendfile(out_fd, in_fd, &safe_offset, count);
 	*offset = (uoff_t)safe_offset;
 
+	if (ret == 0) {
+		errno = EPIPE;
+		ret = -1;
+	}
 	return ret;
 }
 



More information about the dovecot-cvs mailing list