Re: [PATCH xserver 3/6] os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT

2017-12-13 Thread Olivier Fourdan
On Mon, Nov 20, 2017 at 9:43 PM, Adam Jackson  wrote:

> SIGQUIT is a normal termination request, but any other signal we handle
> here wants a core. This has the effect of making FatalError's call to
> AbortServer trigger the
>
> if (CoreDump)
> OsAbort();
>
> path. This will allow us to remove some DDX code that has the same net
> effect.
>
> Signed-off-by: Adam Jackson 
> ---
>  os/osinit.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/os/osinit.c b/os/osinit.c
> index cd769d181c..8575319fff 100644
> --- a/os/osinit.c
> +++ b/os/osinit.c
> @@ -52,6 +52,7 @@ SOFTWARE.
>  #include 
>  #include "os.h"
>  #include "osdep.h"
> +#include "opaque.h"
>  #include 
>  #include 
>  #include 
> @@ -74,8 +75,6 @@ SOFTWARE.
>  #define ADMPATH "/usr/adm/X%smsgs"
>  #endif
>
> -extern char *display;
> -
>  #ifdef RLIMIT_DATA
>  int limitDataSpace = -1;
>  #endif
> @@ -151,6 +150,9 @@ OsSigHandler(int signo)
>  }
>  #endif
>
> +if (signo != SIGQUIT)
> +CoreDump = TRUE;
> +
>  FatalError("Caught signal %d (%s). Server aborting\n",
> signo, strsignal(signo));
>  }
> --
> 2.14.3
>
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


If we set Coredump to TRUE here for all signals but SIGQUIT, do we still
need the “-core” command line option?

Anyway, LGTM.

Reviewed-by: Olivier Fourdan 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 3/6] os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT

2017-11-20 Thread Adam Jackson
SIGQUIT is a normal termination request, but any other signal we handle
here wants a core. This has the effect of making FatalError's call to
AbortServer trigger the

if (CoreDump)
OsAbort();

path. This will allow us to remove some DDX code that has the same net
effect.

Signed-off-by: Adam Jackson 
---
 os/osinit.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/os/osinit.c b/os/osinit.c
index cd769d181c..8575319fff 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -52,6 +52,7 @@ SOFTWARE.
 #include 
 #include "os.h"
 #include "osdep.h"
+#include "opaque.h"
 #include 
 #include 
 #include 
@@ -74,8 +75,6 @@ SOFTWARE.
 #define ADMPATH "/usr/adm/X%smsgs"
 #endif
 
-extern char *display;
-
 #ifdef RLIMIT_DATA
 int limitDataSpace = -1;
 #endif
@@ -151,6 +150,9 @@ OsSigHandler(int signo)
 }
 #endif
 
+if (signo != SIGQUIT)
+CoreDump = TRUE;
+
 FatalError("Caught signal %d (%s). Server aborting\n",
signo, strsignal(signo));
 }
-- 
2.14.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel