svn commit: r274609 - stable/10/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Mon Nov 17 00:59:46 UTC 2014
Author: kib
Date: Mon Nov 17 00:59:45 2014
New Revision: 274609
URL: https://svnweb.freebsd.org/changeset/base/274609
Log:
MFC r274023:
When other end of the pipe closed during the write, but some bytes
were written, return short write instead of EPIPE.
Modified:
stable/10/sys/kern/sys_pipe.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/kern/sys_pipe.c
==============================================================================
--- stable/10/sys/kern/sys_pipe.c Mon Nov 17 00:57:33 2014 (r274608)
+++ stable/10/sys/kern/sys_pipe.c Mon Nov 17 00:59:45 2014 (r274609)
@@ -1293,13 +1293,13 @@ pipe_write(fp, uio, active_cred, flags,
}
/*
- * Don't return EPIPE if I/O was successful
+ * Don't return EPIPE if any byte was written.
+ * EINTR and other interrupts are handled by generic I/O layer.
+ * Do not pretend that I/O succeeded for obvious user error
+ * like EFAULT.
*/
- if ((wpipe->pipe_buffer.cnt == 0) &&
- (uio->uio_resid == 0) &&
- (error == EPIPE)) {
+ if (uio->uio_resid != orig_resid && error == EPIPE)
error = 0;
- }
if (error == 0)
vfs_timestamp(&wpipe->pipe_mtime);
More information about the svn-src-stable
mailing list