merge rev. 1.4.2.1 to HEAD
int\r
getProcessExitCode (ProcHandle handle, int *pExitCode)\r
{\r
- int wstat;\r
+ int wstat, res;\r
\r
*pExitCode = 0;\r
\r
- if (waitpid(handle, &wstat, WNOHANG) > 0)\r
+ if ((res = waitpid(handle, &wstat, WNOHANG)) > 0)\r
{\r
if (WIFEXITED(wstat))\r
{\r
}\r
}\r
\r
- return 0;\r
+ if (res == 0) return 0;\r
+\r
+ if (errno == ECHILD) \r
+ {\r
+ *pExitCode = 0;\r
+ return 1;\r
+ }\r
+\r
+ return -1;\r
}\r
\r
int waitForProcess (ProcHandle handle)\r