comparison 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
comparison
equal deleted inserted replaced
1453:f560710a6ad1 1454:6b98dc22946d
220 signal(SIGCHLD, sig_handler); 220 signal(SIGCHLD, sig_handler);
221 } else if (signum == SIGTERM) { 221 } else if (signum == SIGTERM) {
222 mcabber_terminate("Killed by SIGTERM"); 222 mcabber_terminate("Killed by SIGTERM");
223 } else if (signum == SIGINT) { 223 } else if (signum == SIGINT) {
224 mcabber_terminate("Killed by SIGINT"); 224 mcabber_terminate("Killed by SIGINT");
225 #ifdef USE_SIGWINCH
226 } else if (signum == SIGWINCH) {
227 ungetch(KEY_RESIZE);
228 #endif
225 } else { 229 } else {
226 scr_LogPrint(LPRINT_LOGNORM, "Caught signal: %d", signum); 230 scr_LogPrint(LPRINT_LOGNORM, "Caught signal: %d", signum);
227 } 231 }
228 } 232 }
229 233
374 credits(); 378 credits();
375 379
376 signal(SIGTERM, sig_handler); 380 signal(SIGTERM, sig_handler);
377 signal(SIGINT, sig_handler); 381 signal(SIGINT, sig_handler);
378 signal(SIGCHLD, sig_handler); 382 signal(SIGCHLD, sig_handler);
383 #ifdef USE_SIGWINCH
384 signal(SIGWINCH, sig_handler);
385 #endif
379 signal(SIGPIPE, SIG_IGN); 386 signal(SIGPIPE, SIG_IGN);
380 387
381 /* Parse command line options */ 388 /* Parse command line options */
382 while (1) { 389 while (1) {
383 int c = getopt(argc, argv, "hVf:"); 390 int c = getopt(argc, argv, "hVf:");