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 files changed, 7 insertions(+), 0 deletions(-) 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) { -- 1.7.7.2