MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ExecuteCommand

Function ExecuteCommand

icinga-installer/icinga-installer.cpp:31–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31static bool ExecuteCommand(const std::string& app, const std::string& arguments)
32{
33 SHELLEXECUTEINFO sei = {};
34 sei.cbSize = sizeof(sei);
35 sei.fMask = SEE_MASK_NOCLOSEPROCESS;
36 sei.lpFile = app.c_str();
37 sei.lpParameters = arguments.c_str();
38 sei.nShow = SW_HIDE;
39 if (!ShellExecuteEx(&sei))
40 return false;
41
42 if (!sei.hProcess)
43 return false;
44
45 WaitForSingleObject(sei.hProcess, INFINITE);
46
47 DWORD exitCode;
48 BOOL res = GetExitCodeProcess(sei.hProcess, &exitCode);
49 CloseHandle(sei.hProcess);
50
51 if (!res)
52 return false;
53
54 return exitCode == 0;
55}
56
57static bool ExecuteIcingaCommand(const std::string& arguments)
58{

Callers 6

ExecuteIcingaCommandFunction · 0.85
UpgradeNSISFunction · 0.85
InstallIcingaFunction · 0.85
ScriptFuncMethod · 0.85
ScriptFuncMethod · 0.85
ScriptFuncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected