MCPcopy Create free account
hub / github.com/ElementsProject/elements / spawnProcess

Method spawnProcess

src/ipc/interfaces.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 {
35 }
36 std::unique_ptr<interfaces::Init> spawnProcess(const char* new_exe_name) override
37 {
38 int pid;
39 int fd = m_process->spawn(new_exe_name, m_process_argv0, pid);
40 LogPrint(::BCLog::IPC, "Process %s pid %i launched\n", new_exe_name, pid);
41 auto init = m_protocol->connect(fd, m_exe_name);
42 Ipc::addCleanup(*init, [this, new_exe_name, pid] {
43 int status = m_process->waitSpawned(pid);
44 LogPrint(::BCLog::IPC, "Process %s pid %i exited with status %i\n", new_exe_name, pid, status);
45 });
46 return init;
47 }
48 bool startSpawnedProcess(int argc, char* argv[], int& exit_status) override
49 {
50 exit_status = EXIT_FAILURE;

Callers 1

echoipcFunction · 0.80

Calls 3

spawnMethod · 0.80
connectMethod · 0.80
waitSpawnedMethod · 0.80

Tested by

no test coverage detected