restarter fixes
authorDmitry Jemerov <yole@intellij.com>
Mon, 12 Jan 2009 16:26:30 +0000 (19:26 +0300)
committerDmitry Jemerov <yole@intellij.com>
Mon, 12 Jan 2009 16:26:30 +0000 (19:26 +0300)
bin/restarter.exe
tools/restarter/restarter.cpp

index 013a915326257daa8ee66fdafbc15c82752b0368..36847872138e0f84ff2bddbff701c594b7d4074a 100644 (file)
Binary files a/bin/restarter.exe and b/bin/restarter.exe differ
index 81c4a6a2568bf8b5f222d24613b122ce8113ac1c..da16821824752e34c214241f904b3f02f953dc5d 100644 (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);