diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-15 15:41:13 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-15 15:41:13 +0000 |
commit | 5b4129a89e9fa3ea3b5d57fc362f682aa85abfc7 (patch) | |
tree | 88fabdc48246ff409c8349d43fac04f5fca1b02b /src | |
parent | 588abed2a7df4fa1723475e41399876f3ee34250 (diff) | |
download | conntrack-tools-5b4129a89e9fa3ea3b5d57fc362f682aa85abfc7.tar.gz conntrack-tools-5b4129a89e9fa3ea3b5d57fc362f682aa85abfc7.zip |
remove unix socket file on exit
Diffstat (limited to 'src')
-rw-r--r-- | src/local.c | 6 | ||||
-rw-r--r-- | src/run.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/local.c b/src/local.c index 9ff5f82..d861e12 100644 --- a/src/local.c +++ b/src/local.c @@ -37,6 +37,7 @@ int local_server_create(struct local_conf *conf) if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &conf->reuseaddr, sizeof(conf->reuseaddr)) == -1) { close(fd); + unlink(conf->path); return -1; } @@ -47,19 +48,22 @@ int local_server_create(struct local_conf *conf) if (bind(fd, (struct sockaddr *) &local, len) == -1) { close(fd); + unlink(conf->path); return -1; } if (listen(fd, conf->backlog) == -1) { close(fd); + unlink(conf->path); return -1; } return fd; } -void local_server_destroy(int fd) +void local_server_destroy(int fd, const char *path) { + unlink(path); close(fd); } @@ -43,7 +43,7 @@ void killer(int foo) nfct_close(STATE(dump)); ignore_pool_destroy(STATE(ignore_pool)); - local_server_destroy(STATE(local)); + local_server_destroy(STATE(local), CONFIG(local).path); STATE(mode)->kill(); unlink(CONFIG(lockfile)); dlog(STATE(log), LOG_NOTICE, "---- shutdown received ----"); |