[PATCH xserver 4/6] xfree86: remove xf86CaughtSignal etc.

Adam Jackson ajax at redhat.com
Mon Nov 20 20:43:06 UTC 2017


This no longer does anything useful.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/common/xf86.h        |  2 --
 hw/xfree86/common/xf86Events.c  | 11 -----------
 hw/xfree86/common/xf86Globals.c |  1 -
 hw/xfree86/common/xf86Helper.c  |  6 ------
 hw/xfree86/common/xf86Init.c    | 17 +++--------------
 hw/xfree86/common/xf86Priv.h    |  2 --
 hw/xfree86/common/xf86Privstr.h |  1 -
 hw/xfree86/doc/ddxDesign.xml    | 10 ----------
 8 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 43b693143e..1c25468942 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -296,8 +296,6 @@ xf86ServerIsResetting(void);
 extern _X_EXPORT Bool
 xf86ServerIsOnlyDetecting(void);
 extern _X_EXPORT Bool
-xf86CaughtSignal(void);
-extern _X_EXPORT Bool
 xf86GetVidModeAllowNonLocal(void);
 extern _X_EXPORT Bool
 xf86GetVidModeEnabled(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index a27c7ff1b0..8a800bd8fd 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -267,17 +267,6 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo)
     InputThreadUnregisterDev(pInfo->fd);
 }
 
-/*
- * xf86SigWrapper --
- *    Catch unexpected signals and exit or continue cleanly.
- */
-int
-xf86SigWrapper(int signo)
-{
-    xf86Info.caughtSignal = TRUE;
-    return 1;                   /* abort */
-}
-
 /*
  * xf86PrintBacktrace --
  *    Print a stack backtrace for debugging purposes.
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index ddf7a8696b..85efe3fc12 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -107,7 +107,6 @@ xf86InfoRec xf86Info = {
     .dontZap = FALSE,
     .dontZoom = FALSE,
     .notrapSignals = FALSE,
-    .caughtSignal = FALSE,
     .currentScreen = NULL,
 #ifdef CSRG_BASED
     .consType = -1,
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 447ed3f8fe..393a7aa881 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1428,12 +1428,6 @@ xf86ServerIsOnlyDetecting(void)
     return xf86DoConfigure;
 }
 
-Bool
-xf86CaughtSignal(void)
-{
-    return xf86Info.caughtSignal;
-}
-
 Bool
 xf86GetVidModeAllowNonLocal(void)
 {
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 994b63b430..57b38d07e7 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -298,16 +298,9 @@ xf86PrivsElevated(void)
 }
 
 static void
-InstallSignalHandlers(void)
+TrapSignals(void)
 {
-    /*
-     * Install signal handler for unexpected signals
-     */
-    xf86Info.caughtSignal = FALSE;
-    if (!xf86Info.notrapSignals) {
-        OsRegisterSigWrapper(xf86SigWrapper);
-    }
-    else {
+    if (xf86Info.notrapSignals) {
         OsSignal(SIGSEGV, SIG_DFL);
         OsSignal(SIGABRT, SIG_DFL);
         OsSignal(SIGILL, SIG_DFL);
@@ -423,7 +416,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
             }
         }
 
-        InstallSignalHandlers();
+        TrapSignals();
 
         /* Initialise the loader */
         LoaderInit();
@@ -960,10 +953,6 @@ ddxGiveUp(enum ExitCode error)
     dbus_core_fini();
 
     xf86CloseLog(error);
-
-    /* If an unexpected signal was caught, dump a core for debugging */
-    if (xf86Info.caughtSignal)
-        OsAbort();
 }
 
 /*
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 22bf5ff240..4fe2b5f336 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -135,8 +135,6 @@ DoShowOptions(void)
 
 extern _X_EXPORT void
 xf86Wakeup(void *blockData, int err);
-extern _X_HIDDEN int
-xf86SigWrapper(int signo);
 extern _X_EXPORT void
 xf86HandlePMEvents(int fd, void *data);
 extern _X_EXPORT int (*xf86PMGetEventFromOs) (int fd, pmEvent * events,
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index e4b479f4f9..c5048a3997 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -64,7 +64,6 @@ typedef struct {
     Bool dontZap;
     Bool dontZoom;
     Bool notrapSignals;         /* don't exit cleanly - die at fault */
-    Bool caughtSignal;
 
     /* graphics part */
     ScreenPtr currentScreen;
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 7579850267..13994f7a91 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -2053,16 +2053,6 @@ functions is as follows:
 
 	</para></blockquote>
 
-      <blockquote><para>
-	  <programlisting>
-    Bool xf86CaughtSignal();
-	  </programlisting>
-	  <blockquote><para>
-      Returns <constant>TRUE</constant> if the server has caught a signal,
-      and <constant>FALSE</constant> otherwise.
-	    </para></blockquote>
-
-	</para></blockquote>
     </sect2>
 
     <sect2>
-- 
2.14.3



More information about the xorg-devel mailing list