summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_pipe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index f3c3c0e..9ee4fde 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1293,13 +1293,13 @@ pipe_write(fp, uio, active_cred, flags, td)
}
/*
- * 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);
OpenPOWER on IntegriCloud