summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeigh <leigh@php.net>2015-03-27 20:14:33 +0100
committerJulien Pauli <jpauli@php.net>2015-05-13 14:18:32 +0200
commitf7952b90cad735e2a588c305d425c24550b3775d (patch)
tree1768e5ded85e3f02fe1193a33431c43738c4c82d
parentc02c4aca007199057201b855f674b6baa9be4c6e (diff)
downloadphp-git-f7952b90cad735e2a588c305d425c24550b3775d.tar.gz
Close fd at the end, otherwise people complain
Even though it's closed when the process terminates!
-rw-r--r--ext/mcrypt/mcrypt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 5f14a9274d..194660d864 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -491,6 +491,14 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
+ if (MCG(fd[RANDOM]) > 0) {
+ close(MCG(fd[RANDOM]));
+ }
+
+ if (MCG(fd[URANDOM]) > 0) {
+ close(MCG(fd[URANDOM]));
+ }
+
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}