[mutter/wip/wayland-display: 53/55] main: fix crash handler



commit aa9856f347d8a543953b4096f151699014465a21
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Mon Jul 29 13:41:30 2013 +0200

    main: fix crash handler
    
    We can't use strsignal as that may cause l10n to load, deadlocking
    on malloc. We can't call meta_tty_reset() inconditionally because
    we may have no MetaTTY

 src/core/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 16c51da..43c02ab 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -372,7 +372,7 @@ crash_handler (int signum)
   MetaWaylandCompositor *compositor;
   MetaTTY *tty;
 
-  snprintf (buffer, 256, "Fatal server error: %s\n", strsignal (signum));
+  snprintf (buffer, 256, "Fatal server error: %d\n", signum);
   write (STDERR_FILENO, buffer, strlen (buffer));
 
   compositor = meta_wayland_compositor_get_default ();
@@ -380,7 +380,8 @@ crash_handler (int signum)
 
   /* Passing FALSE ensures that we only do ioctls, which is
      safe from a signal handler */
-  meta_tty_reset (tty, FALSE);
+  if (tty)
+    meta_tty_reset (tty, FALSE);
 
   /* We can't continue with the default handling, so just exit here */
   _exit(1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]