Fix descriptors leak.

PR:		bin/191002
Reported by:	Ryan Steinmetz
Submitted by:	mjg
This commit is contained in:
Pawel Jakub Dawidek 2014-09-14 09:26:33 +00:00
parent 4f66b23341
commit 863dbc940e

View File

@ -228,6 +228,11 @@ wait_for_file_init(int fd)
PJDLOG_ASSERT(fd != -1);
#ifdef HAVE_KQUEUE
if (wait_for_file_kq != -1) {
close(wait_for_file_kq);
wait_for_file_kq = -1;
}
kq = kqueue();
if (kq == -1) {
pjdlog_errno(LOG_WARNING, "kqueue() failed");