handle SIGTERM as well

This commit is contained in:
Thomas Bernard 2016-01-18 00:19:32 +01:00
parent 68404435b6
commit fd4b4049e7
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,10 @@ int main(int argc, char * * argv)
if(sigaction(SIGINT, &sa, NULL)) {
fprintf(stderr, "Failed to set SIGINT handler.\n");
}
sa.sa_handler = sighandler;
if(sigaction(SIGTERM, &sa, NULL)) {
fprintf(stderr, "Failed to set SIGTERM handler.\n");
}
s = socket(AF_UNIX, SOCK_STREAM, 0);
addr.sun_family = AF_UNIX;