X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/024d189a07d05a71117e35c0fde86fe0e6b89f7d..11586be23b78ec23a6a22cc7fa9f8970a3935782:/server/admin.c diff --git a/server/admin.c b/server/admin.c index 5146fde4..90ef4ef1 100644 --- a/server/admin.c +++ b/server/admin.c @@ -564,8 +564,7 @@ void a_notify(const char *fmt, ...) void a_quit(void) { - close(sock.fd); - if (sockname) unlink(sockname); + a_unlisten(); FOREACH_PEER(p, { p_destroy(p, 1); }); ps_quit(); exit(0); @@ -2597,6 +2596,23 @@ again: sockname = name; } +/* --- @a_unlisten@ --- * + * + * Arguments: --- + * + * Returns: --- + * + * Use: Stops listening to the administration socket and removes it. + */ + +void a_unlisten(void) +{ + if (!sockname) return; + sel_rmfile(&sock); + unlink(sockname); + close(sock.fd); +} + /* --- @a_switcherr@ --- * * * Arguments: ---