restarter fixes

This commit is contained in:
Dmitry Jemerov
2009-01-12 19:26:30 +03:00
parent c58f9a3991
commit e3a057c2bc
2 changed files with 6 additions and 4 deletions
BIN
View File
Binary file not shown.
+6 -4
View File
@@ -9,11 +9,13 @@ int _tmain(int argc, _TCHAR* argv[])
if (argc < 3) return 0;
int ppid = _ttoi(argv [1]);
HANDLE parent_process = OpenProcess(SYNCHRONIZE, FALSE, ppid);
if (!parent_process) return 0;
WaitForSingleObject(parent_process, INFINITE);
CloseHandle(parent_process);
if (parent_process)
{
WaitForSingleObject(parent_process, INFINITE);
CloseHandle(parent_process);
}
int rc = _texecv(argv [2], argv+3);
int rc = _texecv(argv [2], argv+2);
if (rc == -1)
{
_tprintf(_T("Error restarting process: errno is %d"), errno);