From: Kalle Wallin Date: Mon, 12 Jul 2004 20:21:15 +0000 (+0000) Subject: Added SIGCONT handler X-Git-Tag: v0.12_alpha1~465 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0884f031a5487e0976dac558bf8ab5b21295b2d8;p=ncmpc.git Added SIGCONT handler git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1856 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- 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);