Skip to content

Commit

Permalink
Another place where we can check before calling close() on an fd.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsaunders committed Oct 19, 2014
1 parent 610542e commit a044698
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/mod_ctrls.c
Expand Up @@ -1217,8 +1217,10 @@ static void ctrls_restart_ev(const void *event_data, void *user_data) {
pr_ctrls_cl_t *cl = NULL;

for (cl = cl_list; cl; cl = cl->cl_next) {
close(cl->cl_fd);
cl->cl_fd = -1;
if (cl->cl_fd >= 0) {
(void) close(cl->cl_fd);
cl->cl_fd = -1;
}
}
}

Expand Down

0 comments on commit a044698

Please sign in to comment.