View | Details | Raw Unified | Return to bug 253422
Collapse All | Expand All

(-)b/sys/kern/sys_generic.c (-6 lines)
Lines 566-577 dofilewrite(struct thread *td, int fd, struct file *fp, struct uio *auio, Link Here
566
		if (auio->uio_resid != cnt && (error == ERESTART ||
566
		if (auio->uio_resid != cnt && (error == ERESTART ||
567
		    error == EINTR || error == EWOULDBLOCK))
567
		    error == EINTR || error == EWOULDBLOCK))
568
			error = 0;
568
			error = 0;
569
		/* Socket layer is responsible for issuing SIGPIPE. */
570
		if (fp->f_type != DTYPE_SOCKET && error == EPIPE) {
571
			PROC_LOCK(td->td_proc);
572
			tdsignal(td, SIGPIPE);
573
			PROC_UNLOCK(td->td_proc);
574
		}
575
	}
569
	}
576
	cnt -= auio->uio_resid;
570
	cnt -= auio->uio_resid;
577
#ifdef KTRACE
571
#ifdef KTRACE
(-)b/sys/kern/sys_pipe.c (-2 / +6 lines)
Lines 1080-1093 pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, Link Here
1080
	    (wpipe->pipe_state & PIPE_EOF)) {
1080
	    (wpipe->pipe_state & PIPE_EOF)) {
1081
		pipeunlock(wpipe);
1081
		pipeunlock(wpipe);
1082
		PIPE_UNLOCK(rpipe);
1082
		PIPE_UNLOCK(rpipe);
1083
		return (EPIPE);
1083
		error = EPIPE;
1084
		goto out;
1084
	}
1085
	}
1085
#ifdef MAC
1086
#ifdef MAC
1086
	error = mac_pipe_check_write(active_cred, wpipe->pipe_pair);
1087
	error = mac_pipe_check_write(active_cred, wpipe->pipe_pair);
1087
	if (error) {
1088
	if (error) {
1088
		pipeunlock(wpipe);
1089
		pipeunlock(wpipe);
1089
		PIPE_UNLOCK(rpipe);
1090
		PIPE_UNLOCK(rpipe);
1090
		return (error);
1091
		goto out;
1091
	}
1092
	}
1092
#endif
1093
#endif
1093
	++wpipe->pipe_busy;
1094
	++wpipe->pipe_busy;
Lines 1318-1323 pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, Link Here
1318
	PIPE_UNLOCK(rpipe);
1319
	PIPE_UNLOCK(rpipe);
1319
	if (uio->uio_resid != orig_resid)
1320
	if (uio->uio_resid != orig_resid)
1320
		td->td_ru.ru_msgsnd++;
1321
		td->td_ru.ru_msgsnd++;
1322
out:
1323
	if (error == EPIPE)
1324
		tdsignal(td, SIGPIPE);
1321
	return (error);
1325
	return (error);
1322
}
1326
}
1323
1327

Return to bug 253422