nlopess Sun Dec 31 14:47:18 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard proc_open.c proc_open.h /php-src NEWS Log: Fixed bug #38542 (proc_get_status() returns wrong PID on windows) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.2&r2=1.36.2.1.2.3&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.2 php-src/ext/standard/proc_open.c:1.36.2.1.2.3 --- php-src/ext/standard/proc_open.c:1.36.2.1.2.2 Thu Dec 28 15:09:29 2006 +++ php-src/ext/standard/proc_open.c Sun Dec 31 14:47:17 2006 @@ -15,7 +15,7 @@ | Author: Wez Furlong <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c,v 1.36.2.1.2.2 2006/12/28 15:09:29 iliaa Exp $ */ +/* $Id: proc_open.c,v 1.36.2.1.2.3 2006/12/31 14:47:17 nlopess Exp $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ @@ -216,10 +216,10 @@ #ifdef PHP_WIN32 - WaitForSingleObject(proc->child, INFINITE); - GetExitCodeProcess(proc->child, &wstatus); + WaitForSingleObject(proc->childHandle, INFINITE); + GetExitCodeProcess(proc->childHandle, &wstatus); FG(pclose_ret) = wstatus; - CloseHandle(proc->child); + CloseHandle(proc->childHandle); #elif HAVE_SYS_WAIT_H @@ -315,7 +315,7 @@ ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", le_proc_open); #ifdef PHP_WIN32 - TerminateProcess(proc->child, 255); + TerminateProcess(proc->childHandle, 255); #else kill(proc->child, sig_no); #endif @@ -371,7 +371,7 @@ #ifdef PHP_WIN32 - GetExitCodeProcess(proc->child, &wstatus); + GetExitCodeProcess(proc->childHandle, &wstatus); running = wstatus == STILL_ACTIVE; exitcode == STILL_ACTIVE ? -1 : wstatus; @@ -470,6 +470,7 @@ struct php_proc_open_descriptor_item descriptors[PHP_PROC_OPEN_MAX_DESCRIPTORS]; #ifdef PHP_WIN32 PROCESS_INFORMATION pi; + HANDLE childHandle; STARTUPINFO si; BOOL newprocok; SECURITY_ATTRIBUTES security; @@ -747,7 +748,8 @@ goto exit_fail; } - child = pi.hProcess; + childHandle = pi.hProcess; + child = pi.dwProcessId; CloseHandle(pi.hThread); #elif defined(NETWARE) @@ -870,6 +872,9 @@ proc->command = command; proc->npipes = ndesc; proc->child = child; +#ifdef PHP_WIN32 + proc->childHandle = childHandle; +#endif proc->env = env; if (pipes != NULL) { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.h?r1=1.5.2.1&r2=1.5.2.1.2.1&diff_format=u Index: php-src/ext/standard/proc_open.h diff -u php-src/ext/standard/proc_open.h:1.5.2.1 php-src/ext/standard/proc_open.h:1.5.2.1.2.1 --- php-src/ext/standard/proc_open.h:1.5.2.1 Sun Jan 1 12:50:15 2006 +++ php-src/ext/standard/proc_open.h Sun Dec 31 14:47:17 2006 @@ -15,11 +15,11 @@ | Author: Wez Furlong <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.h,v 1.5.2.1 2006/01/01 12:50:15 sniper Exp $ */ +/* $Id: proc_open.h,v 1.5.2.1.2.1 2006/12/31 14:47:17 nlopess Exp $ */ #ifdef PHP_WIN32 typedef HANDLE php_file_descriptor_t; -typedef HANDLE php_process_id_t; +typedef DWORD php_process_id_t; #else typedef int php_file_descriptor_t; typedef pid_t php_process_id_t; @@ -40,6 +40,9 @@ struct php_process_handle { php_process_id_t child; +#ifdef PHP_WIN32 + HANDLE childHandle; +#endif int npipes; long pipes[PHP_PROC_OPEN_MAX_DESCRIPTORS]; char *command; http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.465&r2=1.2027.2.547.2.466&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.465 php-src/NEWS:1.2027.2.547.2.466 --- php-src/NEWS:1.2027.2.547.2.465 Sat Dec 30 15:43:10 2006 +++ php-src/NEWS Sun Dec 31 14:47:17 2006 @@ -48,6 +48,7 @@ - Fixed bug #39435 ('foo' instanceof bar gives invalid opcode error). (Sara) - Fixed bugs #39361 & #39400 (mbstring function overloading problem). (Seiji) - Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes) +- Fixed bug #38542 (proc_get_status() returns wrong PID on windows). (Nuno) - Fixed bug #37588 (COM Property propputref converts to PHP function and can't be accesed). (Rob) - Fixed bug #36392 (wrong number of decimal digits with %e specifier in
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php