diff options
| author | Joe Watkins <krakjoe@php.net> | 2017-01-06 06:55:09 +0000 |
|---|---|---|
| committer | Joe Watkins <krakjoe@php.net> | 2017-01-06 06:56:50 +0000 |
| commit | ff6b309c6f4c26ffedd5fc9e4cd021b7300617a3 (patch) | |
| tree | 8a9afacc94629c777547cbe83a3e4e497a090e7e /ext/standard/proc_open.c | |
| parent | b0ff9ee6886f852c458bd877414a9b51e2acb0e9 (diff) | |
| parent | e7f23e164bb869b1a45bf0865e2d32f01c81b16f (diff) | |
| download | php-git-ff6b309c6f4c26ffedd5fc9e4cd021b7300617a3.tar.gz | |
Merge branch 'pull-request/1588' into PHP-7.0
* pull-request/1588:
Fixed #69442 closing of fd incorrect when PTS enabled
Diffstat (limited to 'ext/standard/proc_open.c')
| -rw-r--r-- | ext/standard/proc_open.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 12d7090ac4..b274dc462b 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -820,6 +820,12 @@ PHP_FUNCTION(proc_open) } #endif +#if PHP_CAN_DO_PTS + if (dev_ptmx >= 0) { + close(dev_ptmx); + close(slave_pty); + } +#endif /* close those descriptors that we just opened for the parent stuff, * dup new descriptors into required descriptors and close the original * cruft */ @@ -835,13 +841,6 @@ PHP_FUNCTION(proc_open) close(descriptors[i].childend); } -#if PHP_CAN_DO_PTS - if (dev_ptmx >= 0) { - close(dev_ptmx); - close(slave_pty); - } -#endif - if (cwd) { php_ignore_value(chdir(cwd)); } |
