nlopess Wed Feb 14 19:13:31 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/general_functions bug39322.phpt proc_open02.phpt
Modified files: /php-src NEWS /php-src/ext/standard proc_open.c Log: Fixed bug #39322 (proc_terminate() destroys process resource) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.537&r2=1.2027.2.547.2.538&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.537 php-src/NEWS:1.2027.2.547.2.538 --- php-src/NEWS:1.2027.2.547.2.537 Tue Feb 13 19:53:42 2007 +++ php-src/NEWS Wed Feb 14 19:13:31 2007 @@ -16,6 +16,7 @@ - Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9). (Tony) - Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony) - Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus) +- Fixed bug #39322 (proc_terminate() destroys process resource). (Nuno) - Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno) - Fixed bug #34794 (proc_close() hangs when used with two processes). (jdolecek at netbsd dot org, Nuno) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.10&r2=1.36.2.1.2.11&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.10 php-src/ext/standard/proc_open.c:1.36.2.1.2.11 --- php-src/ext/standard/proc_open.c:1.36.2.1.2.10 Tue Feb 13 19:53:42 2007 +++ php-src/ext/standard/proc_open.c Wed Feb 14 19:13:31 2007 @@ -15,7 +15,7 @@ | Author: Wez Furlong <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c,v 1.36.2.1.2.10 2007/02/13 19:53:42 nlopess Exp $ */ +/* $Id: proc_open.c,v 1.36.2.1.2.11 2007/02/14 19:13:31 nlopess Exp $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ @@ -300,7 +300,7 @@ } /* }}} */ -/* {{{ proto int proc_terminate(resource process [, long signal]) +/* {{{ proto bool proc_terminate(resource process [, long signal]) kill a process opened by proc_open */ PHP_FUNCTION(proc_terminate) { @@ -315,13 +315,18 @@ ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", le_proc_open); #ifdef PHP_WIN32 - TerminateProcess(proc->childHandle, 255); + if (TerminateProcess(proc->childHandle, 255)) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } #else - kill(proc->child, sig_no); + if (kill(proc->child, sig_no) == 0) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } #endif - - zend_list_delete(Z_LVAL_P(zproc)); - RETURN_LONG(FG(pclose_ret)); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug39322.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/general_functions/bug39322.phpt +++ php-src/ext/standard/tests/general_functions/bug39322.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt +++ php-src/ext/standard/tests/general_functions/proc_open02.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php