diff options
author | cos <cos> | 2023-11-08 15:02:19 +0100 |
---|---|---|
committer | cos <cos> | 2023-11-08 15:07:39 +0100 |
commit | 2f977c646a0ff491b3814e7d3843259ec9c7c4e2 (patch) | |
tree | a8d41526907b40f04114ba873e0098ed45d91a0c /mcwm.c | |
parent | e4b558fa9e063be7e1a48d4d90d3f69f4ad3df71 (diff) | |
download | mcwm-2f977c646a0ff491b3814e7d3843259ec9c7c4e2.zip |
Fix unintentional exit on suspend
Suspending xorg on FreeBSD (and possibly other scenarios) results in a
recoverable INTR from select(). Only exit on signal after actually
having recieved a signal.
Diffstat (limited to 'mcwm.c')
-rw-r--r-- | mcwm.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -3593,6 +3593,7 @@ void events(void) int fd; /* Our X file descriptor */ fd_set in; /* For select */ int found; /* Ditto. */ + int err; /* Get the file descriptor so we can do select() on it. */ fd = xcb_get_file_descriptor(conn); @@ -3621,8 +3622,9 @@ void events(void) * Check if we have an unrecoverable connection error, * like a disconnected X server. */ - if (xcb_connection_has_error(conn)) + if ((err = xcb_connection_has_error(conn))) { + PDEBUG("xcb_connection_has_error() returned %d.\n", err); cleanup(0); exit(1); } @@ -3632,8 +3634,10 @@ void events(void) { if (EINTR == errno) { - /* We received a signal. Break out of loop. */ - break; + if (sigcode != 0) { + /* We received a signal. Break out of loop. */ + break; + } } else { |