Skip to content

Commit

Permalink
ignore sigpipe
Browse files Browse the repository at this point in the history
conmon getting killed from SIGPIPE is another way it can be spuriously killed. These situations are very hard to recover from, so we should ignore them.

This also fixes an issue where occasionally the splice() call to masterfd_stdin causes conmon to crash. It's pretty racy to try to check if stdin is still open, so we should just not crash instead

Signed-off-by: Peter Hunt <[email protected]>
  • Loading branch information
haircommander committed Mar 17, 2020
1 parent 10823ae commit 85c9a12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/conmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,8 @@ int main(int argc, char *argv[])
close(oom_score_fd);
}

/* ignoring SIGPIPE prevents conmon from being spuriously killed */
signal(SIGPIPE, SIG_IGN);

main_loop = g_main_loop_new(NULL, FALSE);

Expand Down

0 comments on commit 85c9a12

Please sign in to comment.