summaryrefslogtreecommitdiff
path: root/ext/standard/proc_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/proc_open.c')
-rw-r--r--ext/standard/proc_open.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index ff38e75d3f..d9508dfecc 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -854,6 +854,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 */
@@ -869,13 +875,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));
}