From: Matthew Dillon Date: Thu, 12 Jan 2012 19:06:59 +0000 (-0800) Subject: vknetd - Ignore SIGPIPE X-Git-Tag: v3.0.0~95 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1709135ea19db22695e1f94232a4b95cc2e27a66 vknetd - Ignore SIGPIPE * Ignore SIGPIPE, fixing an undesired kill of vknetd when a write() races a vkernel termination. Reported-by: tuxillo --- diff --git a/usr.sbin/vknetd/vknetd.c b/usr.sbin/vknetd/vknetd.c index 22e7581..586c137 100644 --- a/usr.sbin/vknetd/vknetd.c +++ b/usr.sbin/vknetd/vknetd.c @@ -106,6 +106,13 @@ main(int ac, char **av) SetAddrOpt = 1; /* + * Ignore SIGPIPE to prevent write() races against disconnecting + * clients from killing vknetd. Should be inherited by all I/O + * threads. + */ + signal(SIGPIPE, SIG_IGN); + + /* * Special connect/debug mode */ if (connectOpt) {