xserver: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Feb 23 23:18:48 UTC 2024
hw/xquartz/quartzStartup.c | 2 +-
include/busfault.h | 7 ++++++-
include/meson.build | 2 --
os/WaitFor.c | 2 --
os/meson.build | 2 +-
os/osinit.c | 2 --
6 files changed, 8 insertions(+), 9 deletions(-)
New commits:
commit eed0697ec9cf39da42c22dbd94d9addadd841fb0
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed Feb 14 15:31:56 2024 +0100
os: consolidate busfault handling
The symbols HAVE_SIGACTION and BUSFAULT are set under the same conditions,
so can be consolidated into one. Also define dummies when HAVE_SIGACTION
is not set, so a few #ifdef's less clutterig the code.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1297>
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 732eba983..77ff84506 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -99,7 +99,7 @@ QuartzInitServer(int argc, char **argv, char **envp)
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGALRM);
-#ifdef BUSFAULT
+#ifdef HAVE_SIGACTION
sigaddset(&set, SIGBUS);
#endif
pthread_sigmask(SIG_BLOCK, &set, NULL);
diff --git a/include/busfault.h b/include/busfault.h
index 3b668818d..f89a5833e 100644
--- a/include/busfault.h
+++ b/include/busfault.h
@@ -25,7 +25,7 @@
#include <dix-config.h>
-#ifdef BUSFAULT
+#ifdef HAVE_SIGACTION
#include <sys/types.h>
@@ -43,6 +43,11 @@ busfault_check(void);
Bool
busfault_init(void);
+#else
+
+static inline void busfault_check(void) {}
+static inline Bool busfault_init(void) { return FALSE; }
+
#endif
#endif /* _BUSFAULT_H_ */
diff --git a/include/meson.build b/include/meson.build
index 6ec1a96f8..c109bcc40 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -179,8 +179,6 @@ conf_data.set('HAVE_VSNPRINTF', cc.has_function('vsnprintf') ? '1' : false)
conf_data.set('HAVE_WALKCONTEXT', cc.has_function('walkcontext') ? '1' : false)
conf_data.set('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include <sys/ucred.h>') ? '1' : false)
-conf_data.set('BUSFAULT', conf_data.get('HAVE_SIGACTION'))
-
# Don't let X dependencies typedef 'pointer'
conf_data.set('_XTYPEDEF_POINTER', '1')
conf_data.set('_XITYPEDEF_POINTER', '1')
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 1bb4ecc45..f34964f2e 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -180,9 +180,7 @@ WaitForSomething(Bool are_ready)
were_ready = FALSE;
-#ifdef BUSFAULT
busfault_check();
-#endif
/* We need a while loop here to handle
crashed connections and the screen saver timeout */
diff --git a/os/meson.build b/os/meson.build
index 85b445f20..a6cf8a444 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -46,7 +46,7 @@ if conf_data.get('HAVE_POLL').to_int() == 0
srcs_os += 'xserver_poll.c'
endif
-if conf_data.get('BUSFAULT').to_int() != 0
+if conf_data.get('HAVE_SIGACTION').to_int() != 0
srcs_os += 'busfault.c'
endif
diff --git a/os/osinit.c b/os/osinit.c
index 8575319ff..db8427ba9 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -199,9 +199,7 @@ OsInit(void)
}
}
#endif /* !WIN32 || __CYGWIN__ */
-#ifdef BUSFAULT
busfault_init();
-#endif
server_poll = ospoll_create();
if (!server_poll)
FatalError("failed to allocate poll structure");
More information about the xorg-commit
mailing list