diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-08-04 08:48:26 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-08-04 08:48:26 +0000 |
commit | e2a6f80bc6c71cfe6a68f419b2561d6d32252a88 (patch) | |
tree | efbfdabfda29a9f097e7324d44689129d60b7b89 /src/main.c | |
parent | 22f156f5f87705a9b8cda9958179939d8b3fbdc9 (diff) | |
download | mpd-e2a6f80bc6c71cfe6a68f419b2561d6d32252a88.tar.gz mpd-e2a6f80bc6c71cfe6a68f419b2561d6d32252a88.tar.xz mpd-e2a6f80bc6c71cfe6a68f419b2561d6d32252a88.zip |
the updated sources
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 3dd7b6b94..c00b7ad68 100644 --- a/src/main.c +++ b/src/main.c @@ -135,6 +135,13 @@ catch_sigint( int sig ) } void +catch_sighup( int sig) +{ + printf("\n%s\n", _("Exiting...")); + exit(EXIT_SUCCESS); +} + +void catch_sigcont( int sig ) { D("catch_sigcont()\n"); @@ -239,7 +246,17 @@ main(int argc, const char *argv[]) perror("sigaction(SIGCONT)"); exit(EXIT_FAILURE); } - + + /* setup signal behaviour - SIGHUP*/ + sigemptyset( &act.sa_mask ); + act.sa_flags = 0; + act.sa_handler = catch_sigint; + if( sigaction(SIGHUP, &act, NULL)<0 ) + { + perror("sigaction(SIGHUP)"); + exit(EXIT_FAILURE); + } + /* install exit function */ atexit(exit_and_cleanup); |