cvs: php-src(PHP_5_2) /ext/standard proc_open.c
| From: | Dmitry Stogov | Date: | Tue, 09 Jan 2007 16:27:17 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard proc_open.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42632@lists.php.net to get a copy of this message | ||
dmitry Tue Jan 9 16:27:17 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard proc_open.c
Log:
Close open files in case of failure (Amit)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.7&r2=1.36.2.1.2.8&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.36.2.1.2.7 php-src/ext/standard/proc_open.c:1.36.2.1.2.8
--- php-src/ext/standard/proc_open.c:1.36.2.1.2.7 Sat Jan 6 09:02:02 2007
+++ php-src/ext/standard/proc_open.c Tue Jan 9 16:27:17 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.c,v 1.36.2.1.2.7 2007/01/06 09:02:02 dmitry Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.8 2007/01/09 16:27:17 dmitry Exp $ */
#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */
@@ -755,6 +755,13 @@
}
if (FALSE == newprocok) {
+ /* clean up all the descriptors */
+ for (i = 0; i < ndesc; i++) {
+ CloseHandle(descriptors[i].childend);
+ if (descriptors[i].parentend) {
+ CloseHandle(descriptors[i].parentend);
+ }
+ }
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed");
goto exit_fail;
}