]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 7 May 2010 20:58:50 +0000 (20:58 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 7 May 2010 20:58:50 +0000 (20:58 +0000)
commit469c68834282dd89c431c3a63c63cc8e6543f6e9
treea6aa346ebf4ffd87f9707ffd54886cf33bb9d556
parent4fa1e3d493f71adf288922774ab27e17871bbf2f
MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.

Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.

The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.

PR: 19773
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@207758 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/telnet/telnet/commands.c
contrib/telnet/telnet/externs.h
contrib/telnet/telnet/network.c
contrib/telnet/telnet/sys_bsd.c
contrib/telnet/telnet/telnet.c
contrib/telnet/telnet/terminal.c