summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r--src/nxt_runtime.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index cb5fe421..739238af 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -563,6 +563,7 @@ nxt_runtime_exit(nxt_task_t *task, void *obj, void *data)
#if (NXT_HAVE_UNIX_DOMAIN)
{
+ size_t i;
nxt_sockaddr_t *sa;
nxt_file_name_t *name;
@@ -572,6 +573,22 @@ nxt_runtime_exit(nxt_task_t *task, void *obj, void *data)
name = (nxt_file_name_t *) sa->u.sockaddr_un.sun_path;
(void) nxt_file_delete(name);
}
+
+ for (i = 0; i < rt->listen_sockets->nelts; i++) {
+ nxt_listen_socket_t *ls;
+
+ ls = (nxt_listen_socket_t *) rt->listen_sockets->elts + i;
+ sa = ls->sockaddr;
+
+ if (sa->u.sockaddr.sa_family != AF_UNIX
+ || sa->u.sockaddr_un.sun_path[0] == '\0')
+ {
+ continue;
+ }
+
+ name = (nxt_file_name_t *) sa->u.sockaddr_un.sun_path;
+ (void) nxt_file_delete(name);
+ }
}
#endif
}