blob: b0fe5578e7c46fe8fcc2a56c88f3dd4c0415a5e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
From 11addea193c69833c5aa8e1da72fb9e1b2be2f1d Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@debian.org>
Date: Sun, 29 Mar 2020 18:03:50 +0800
Subject: Do not core dump when exiting due to loss of X connection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The `g_critical` function will core dump if critical errors are marked fatal
(which they are in xss-lock). Instead log as informational and exit.
Thanks to Tomáš Janoušek for the bug report and original patch. Closes:
---
src/xss-lock.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/xss-lock.c b/src/xss-lock.c
index 31e161d..95f049c 100644
--- a/src/xss-lock.c
+++ b/src/xss-lock.c
@@ -161,10 +161,12 @@ screensaver_event_cb(xcb_connection_t *connection, xcb_generic_event_t *event,
const int *const xcb_screensaver_notify)
{
uint8_t event_type;
-
- if (!event)
- g_critical("X connection lost; exiting.");
-
+
+ if (!event) {
+ g_info("X connection lost; exiting.");
+ exit(EXIT_FAILURE);
+ }
+
event_type = XCB_EVENT_RESPONSE_TYPE(event);
if (event_type == 0) {
xcb_generic_error_t *error = (xcb_generic_error_t *)event;
|