Skip to content
Snippets Groups Projects
Commit b7fbb3cb authored by cnlohr's avatar cnlohr
Browse files

Make sigpipe exit cleanly.

parent a1748b9c
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,8 @@ static int ReadKBByte()
static void CtrlC()
{
fprintf( stderr, "Minichlink Closing\n" );
ResetKeyboardInput();
exit( 0 );
}
......@@ -105,6 +107,7 @@ static void CaptureKeyboardInput()
// Hook exit, because we want to re-enable keyboard.
atexit(ResetKeyboardInput);
signal(SIGINT, CtrlC);
signal(SIGPIPE, CtrlC);
struct termios term;
tcgetattr(0, &term);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment