> -----Original Message-----
> From: Martin Sebor [mailto:[EMAIL PROTECTED]
> Sent: Saturday, August 19, 2006 1:25 AM
> To: [email protected]
> Subject: Re: [patch] exec utility windows port
>
> Andrew Black wrote:
> > Greetings
> >
> > Attached is a patch that adds return value checking to the
> CloseHandle
> > and WaitForSingleObject calls added in Farid's patch.
>
> Okaly dokaly: http://svn.apache.org/viewvc?rev=432749&view=rev
>
One more patch for that patch (attached):
* exec.cpp [_WIN32 || _WIN64] (exec_file): WAIT_FAIL replaced
with WAIT_FAILED; fixed incorrect parameter in calls CloseHandle
and WaitForSingleObject.
Farid.
Index: exec.cpp
===================================================================
--- exec.cpp (revision 433231)
+++ exec.cpp (working copy)
@@ -952,7 +952,7 @@
if (-1 == status.status)
return status;
- if (0 == CloseHandle (context.hThread))
+ if (0 == CloseHandle (child.hThread))
warn_last_error ("Closing child main thread handle");
/* Wait for the child process to terminate */
@@ -970,7 +970,7 @@
status.error = warn_last_error ("Waiting for child process");
}
- if (0 == CloseHandle (context.hProcess))
+ if (0 == CloseHandle (child.hProcess))
warn_last_error ("Closing child process handle");
return status;
}
@@ -1012,7 +1012,7 @@
status.error = warn_last_error ("Waiting for child process");
}
- if (0 == CloseHandle (context.hProcess))
+ if (0 == CloseHandle (child.hProcess))
warn_last_error ("Closing child process handle");
return status;
}
@@ -1020,7 +1020,7 @@
/* Then hard kill the child process */
if (0 == TerminateProcess (child.hProcess, 3))
warn_last_error ("Terminating child process");
- else if (WAIT_FAIL == WaitForSingleObject (child.hProcess, 1000))
+ else if (WAIT_FAILED == WaitForSingleObject (child.hProcess, 1000))
warn_last_error ("Waiting for child process");
if (0 == GetExitCodeProcess (child.hProcess, &status.status)) {
@@ -1028,7 +1028,7 @@
status.status = -1;
}
status.error = 3;
- if (0 == CloseHandle (context.hProcess))
+ if (0 == CloseHandle (child.hProcess))
warn_last_error ("Closing child process handle");
return status;
}