startup activity assertions
[fedora-idea.git] / tools / restarter / restarter.cpp
blobda16821824752e34c214241f904b3f02f953dc5d
1 // restarter.cpp : Defines the entry point for the console application.
2 //
4 #include "stdafx.h"
7 int _tmain(int argc, _TCHAR* argv[])
9 if (argc < 3) return 0;
10 int ppid = _ttoi(argv [1]);
11 HANDLE parent_process = OpenProcess(SYNCHRONIZE, FALSE, ppid);
12 if (parent_process)
14 WaitForSingleObject(parent_process, INFINITE);
15 CloseHandle(parent_process);
18 int rc = _texecv(argv [2], argv+2);
19 if (rc == -1)
21 _tprintf(_T("Error restarting process: errno is %d"), errno);
24 return 0;