Ignore SIGPIPE to prevent sudden exit when control socket is closed
authorDavin McCall <davmac@davmac.org>
Thu, 23 Jun 2016 10:33:30 +0000 (11:33 +0100)
committerDavin McCall <davmac@davmac.org>
Thu, 23 Jun 2016 10:33:30 +0000 (11:33 +0100)
src/dinit.cc

index eaea6f52ba771182a2596027efda4c454514315f..3ee5a62bbf76fea5c4424eabb3083690b4bb060c 100644 (file)
@@ -250,6 +250,8 @@ int main(int argc, char **argv)
     signal(SIGTTIN, SIG_IGN);
     signal(SIGTTOU, SIG_IGN);
     
+    signal(SIGPIPE, SIG_IGN);
+    
     if (! am_system_init && ! control_socket_path_set) {
         const char * userhome = get_user_home();
         if (userhome != nullptr) {