ipc: Correctly deal with SIGPIPE/failing write()s

If a client disconnects while i3 still wants to write the reply, this
could lead to exits of i3 before.
This commit is contained in:
Michael Stapelberg
2010-03-12 15:02:00 +01:00
parent 0f5256dc72
commit 5a3d1b38e8
2 changed files with 9 additions and 2 deletions

View File

@ -527,6 +527,11 @@ int main(int argc, char *argv[], char *env[]) {
xcb_check_cb(NULL, NULL, 0);
setup_signal_handler();
/* Ignore SIGPIPE to survive errors when an IPC client disconnects
* while we are sending him a message */
signal(SIGPIPE, SIG_IGN);
/* Ungrab the server to receive events and enter libevs eventloop */
xcb_ungrab_server(conn);