From 5a5fa91d2dc9fefbb888ccf5d7123993c2716aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 21 May 2015 20:30:50 +0300 Subject: [PATCH] rootwrap: use BSD SO_NOSIGPIPE --- bin/rootwrap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/rootwrap.c b/bin/rootwrap.c index 6e49ee8f22..55944aced3 100644 --- a/bin/rootwrap.c +++ b/bin/rootwrap.c @@ -193,6 +193,10 @@ int main (int argc, char *argv[]) if (pair[0] < 3) goto error; /* we want 0, 1 and 2 open */ +#ifdef SO_NOSIGPIPE + setsockopt(pair[1], SOL_SOCKET, SO_NOSIGPIPE, &(int){ 1 }, sizeof (int)); +#endif + pid_t pid = fork (); switch (pid) {