diff options
Diffstat (limited to 'exit.c')
-rw-r--r-- | exit.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -5,14 +5,17 @@ #include "cmogstored.h" #include "nostd/setproctitle.h" -static void acceptor_quit(int fd) +static void acceptor_quit(int *fdp) { + int fd = *fdp; + if (fd >= 0) { struct mog_fd *mfd = mog_fd_get(fd); struct mog_accept *ac = &mfd->as.accept; mog_thrpool_quit(&ac->thrpool, NULL); mog_fd_put(mfd); + *fdp = -1; } } @@ -20,9 +23,9 @@ static bool svc_quit_accept_i(void *svcptr, void *ignored) { struct mog_svc *svc = svcptr; - acceptor_quit(svc->mgmt_fd); - acceptor_quit(svc->http_fd); - acceptor_quit(svc->httpget_fd); + acceptor_quit(&svc->mgmt_fd); + acceptor_quit(&svc->http_fd); + acceptor_quit(&svc->httpget_fd); return true; } |