diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-12-27 21:46:10 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-12-27 21:48:19 +0100 |
commit | 4755ad22cdfa2c7414cc66e068b884f90f2cc639 (patch) | |
tree | 3023fb98195d447dec0d4f3696d61fdd8a428138 /src/blogc-runserver/main.c | |
parent | 5359e0ca10669b08eebd1beaaa2e9fb05cf9ac52 (diff) | |
download | blogc-4755ad22cdfa2c7414cc66e068b884f90f2cc639.tar.gz blogc-4755ad22cdfa2c7414cc66e068b884f90f2cc639.tar.bz2 blogc-4755ad22cdfa2c7414cc66e068b884f90f2cc639.zip |
runserver: exit cleanly on ^C
Diffstat (limited to 'src/blogc-runserver/main.c')
-rw-r--r-- | src/blogc-runserver/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/blogc-runserver/main.c b/src/blogc-runserver/main.c index 3b6f2c2..6ac638d 100644 --- a/src/blogc-runserver/main.c +++ b/src/blogc-runserver/main.c @@ -44,10 +44,17 @@ print_usage(void) } +void sigint_handler(int sig) { + printf("\n"); + exit(0); +} + + int main(int argc, char **argv) { signal(SIGPIPE, SIG_IGN); + signal(SIGINT, sigint_handler); int rv = 0; char *host = NULL; |