From 1709135ea19db22695e1f94232a4b95cc2e27a66 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 12 Jan 2012 11:06:59 -0800 Subject: [PATCH] vknetd - Ignore SIGPIPE * Ignore SIGPIPE, fixing an undesired kill of vknetd when a write() races a vkernel termination. Reported-by: tuxillo --- usr.sbin/vknetd/vknetd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/vknetd/vknetd.c b/usr.sbin/vknetd/vknetd.c index 22e7581a9c..586c1376e4 100644 --- a/usr.sbin/vknetd/vknetd.c +++ b/usr.sbin/vknetd/vknetd.c @@ -105,6 +105,13 @@ main(int ac, char **av) if (ac) 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 */ -- 2.41.0