From 0884f031a5487e0976dac558bf8ab5b21295b2d8 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 12 Jul 2004 20:21:15 +0000 Subject: [PATCH] Added SIGCONT handler git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1856 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/main.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index abe60bf..9497e3b 100644 --- a/src/main.c +++ b/src/main.c @@ -133,6 +133,13 @@ catch_sigint( int sig ) exit(EXIT_SUCCESS); } +void +catch_sigcont( int sig ) +{ + D("catch_sigcont()\n"); + screen_resize(); +} + #ifdef DEBUG void D(char *format, ...) @@ -196,7 +203,7 @@ main(int argc, const char *argv[]) sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = catch_sigint; - if( sigaction( SIGINT, &act, NULL )<0 ) + if( sigaction(SIGINT, &act, NULL)<0 ) { perror("signal"); exit(EXIT_FAILURE); @@ -205,11 +212,20 @@ main(int argc, const char *argv[]) sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = catch_sigint; - if( sigaction( SIGTERM, &act, NULL )<0 ) + if( sigaction(SIGTERM, &act, NULL)<0 ) { perror("sigaction()"); exit(EXIT_FAILURE); } + /* setup signal behavior - SIGCONT */ + sigemptyset( &act.sa_mask ); + act.sa_flags = 0; + act.sa_handler = catch_sigcont; + if( sigaction(SIGCONT, &act, NULL)<0 ) + { + perror("sigaction(SIGCONT)"); + exit(EXIT_FAILURE); + } /* install exit function */ atexit(exit_and_cleanup); -- 2.30.2