diff mcabber/src/main.c @ 1454:6b98dc22946d

Add optional SIGWINCH handler (Markus Hennecke) This patch from Markus Hennecke adds a configure option to provide a SIGWINCH handler. It is useful on some systems like OpenBSD where there is no default handler for this signal.
author Mikael Berthe <mikael@lilotux.net>
date Thu, 03 Apr 2008 21:20:56 +0200
parents 844410b9b4cc
children 35020a2ed115
line wrap: on
line diff
--- a/mcabber/src/main.c	Wed Apr 02 22:31:23 2008 +0200
+++ b/mcabber/src/main.c	Thu Apr 03 21:20:56 2008 +0200
@@ -222,6 +222,10 @@
     mcabber_terminate("Killed by SIGTERM");
   } else if (signum == SIGINT) {
     mcabber_terminate("Killed by SIGINT");
+#ifdef USE_SIGWINCH
+  } else if (signum == SIGWINCH) {
+    ungetch(KEY_RESIZE);
+#endif
   } else {
     scr_LogPrint(LPRINT_LOGNORM, "Caught signal: %d", signum);
   }
@@ -376,6 +380,9 @@
   signal(SIGTERM, sig_handler);
   signal(SIGINT,  sig_handler);
   signal(SIGCHLD, sig_handler);
+#ifdef USE_SIGWINCH
+  signal(SIGWINCH, sig_handler);
+#endif
   signal(SIGPIPE, SIG_IGN);
 
   /* Parse command line options */