mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-02-08 23:01:51 +00:00
Add ProcessUtils::runSync() stub for Windows and fix compilation of waitForProcess()
This commit is contained in:
parent
9530256732
commit
fc6101a9ec
3 changed files with 14 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define PLATFORM_WINDOWS
|
#define PLATFORM_WINDOWS
|
||||||
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
|
@ -43,6 +43,15 @@ int ProcessUtils::runSyncUnix(const std::string& executable,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
int ProcessUtils::runSyncWindows(const std::string& executable,
|
||||||
|
const std::list<std::string>& args)
|
||||||
|
{
|
||||||
|
// TODO - Implement me
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ProcessUtils::runAsync(const std::string& executable,
|
void ProcessUtils::runAsync(const std::string& executable,
|
||||||
const std::list<std::string>& args)
|
const std::list<std::string>& args)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +88,7 @@ bool ProcessUtils::waitForProcess(long long pid)
|
||||||
|
|
||||||
if (!(hProc = OpenProcess(SYNCHRONIZE, FALSE, static_cast<DWORD>(pid))))
|
if (!(hProc = OpenProcess(SYNCHRONIZE, FALSE, static_cast<DWORD>(pid))))
|
||||||
{
|
{
|
||||||
LOG(Error,"Unable to get process handle for pid" + intToStr(pid) + "last error" + intToStr(GetLastError()));
|
LOG(Error,"Unable to get process handle for pid " + intToStr(pid) + " last error " + intToStr(GetLastError()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +97,7 @@ bool ProcessUtils::waitForProcess(long long pid)
|
||||||
|
|
||||||
if (dwRet == WAIT_FAILED)
|
if (dwRet == WAIT_FAILED)
|
||||||
{
|
{
|
||||||
debug_logger(m_debugLog) << "WaitForSingleObject failed with error" << GetLastError();
|
LOG(Error,"WaitForSingleObject failed with error " + intToStr(GetLastError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (dwRet == WAIT_OBJECT_0);
|
return (dwRet == WAIT_OBJECT_0);
|
||||||
|
|
|
@ -33,5 +33,7 @@ class ProcessUtils
|
||||||
const std::list<std::string>& args);
|
const std::list<std::string>& args);
|
||||||
static int runSyncUnix(const std::string& executable,
|
static int runSyncUnix(const std::string& executable,
|
||||||
const std::list<std::string>& args);
|
const std::list<std::string>& args);
|
||||||
|
static int runSyncWindows(const std::string& executable,
|
||||||
|
const std::list<std::string>& args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue