summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-04-20 16:24:15 -0700
committerStanislav Malyshev <stas@php.net>2014-04-20 16:25:03 -0700
commit0df431482fba37a3dac433d52cf339f55e81f817 (patch)
tree9803ddadd14176cd3df9379a3c8fe5bb0fc33edb
parent774f16318b3739e751d5a041f3601a3cf3000614 (diff)
parent6bad228b4e0c2429bc2f62f447b56ac54c2f5b04 (diff)
downloadphp-git-0df431482fba37a3dac433d52cf339f55e81f817.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix #66908: php-fpm reload leaks epoll_create() file descriptor
-rw-r--r--NEWS2
-rw-r--r--sapi/fpm/fpm/events/epoll.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e0503fb3ef..a1427512c2 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,8 @@ PHP NEWS
- FPM:
. Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
+ . Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
+ (Julio Pintos)
- JSON:
. Fixed bug #66021 (Blank line inside empty array/object when
diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c
index 2857ea2a09..b55cb44b15 100644
--- a/sapi/fpm/fpm/events/epoll.c
+++ b/sapi/fpm/fpm/events/epoll.c
@@ -46,7 +46,7 @@ static struct fpm_event_module_s epoll_module = {
static struct epoll_event *epollfds = NULL;
static int nepollfds = 0;
-static int epollfd = 0;
+static int epollfd = -1;
#endif /* HAVE_EPOLL */
@@ -103,6 +103,10 @@ static int fpm_event_epoll_clean() /* {{{ */
free(epollfds);
epollfds = NULL;
}
+ if (epollfd != -1) {
+ close(epollfd);
+ epollfd = -1;
+ }
nepollfds = 0;