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

cras at dovecot.org cras at dovecot.org
Wed May 10 14:24:00 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	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.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- sendfile-util.c	12 Jul 2005 13:06:18 -0000	1.13
+++ sendfile-util.c	10 May 2006 11:23:58 -0000	1.13.2.1
@@ -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