abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit c14b9c91737c0de6e797bb43d754bd958b29aaba
parent fcaf5368fab30203c2dda8bb0ae27c69246c1ee7
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 25 Feb 2014 23:36:02 +0100

Unlink socket when server is killed

Diffstat:
abduco.c | 1+
server.c | 4++++
2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/abduco.c b/abduco.c @@ -251,6 +251,7 @@ static bool create_session(const char *name, char * const argv[]) { break; default: /* SIGTTIN, SIGTTU */ + sa.sa_handler = server_sigterm_handler; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); sa.sa_handler = SIG_IGN; diff --git a/server.c b/server.c @@ -126,6 +126,10 @@ static void server_pty_died_handler(int sig) { errno = errsv; } +static void server_sigterm_handler(int sig) { + exit(EXIT_FAILURE); /* invoke atexit handler */ +} + static void server_atexit_handler() { unlink(sockaddr.sun_path); }