diff options
author | alfred <alfred@FreeBSD.org> | 2002-06-20 18:52:54 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-06-20 18:52:54 +0000 |
commit | 619c88aeeb99f6aa38801e896d23cbb5def3a151 (patch) | |
tree | e87489ee79235af36bbac2f16018487df412f86e /sys/kern/sys_generic.c | |
parent | c2afd32ef72eac57b98d33e52cb7d01c26da2dce (diff) | |
download | FreeBSD-src-619c88aeeb99f6aa38801e896d23cbb5def3a151.zip FreeBSD-src-619c88aeeb99f6aa38801e896d23cbb5def3a151.tar.gz |
Implement SO_NOSIGPIPE option for sockets. This allows one to request that
an EPIPE error return not generate SIGPIPE on sockets.
Submitted by: lioux
Inspired by: Darwin
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index bec5cca..1bdd913 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -420,7 +420,8 @@ dofilewrite(td, fp, fd, buf, nbyte, offset, flags) if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; - if (error == EPIPE) { + /* Socket layer is responsible for issuing SIGPIPE. */ + if (error == EPIPE && fp->f_type != DTYPE_SOCKET) { PROC_LOCK(td->td_proc); psignal(td->td_proc, SIGPIPE); PROC_UNLOCK(td->td_proc); |