diff --git a/hss.hpp b/hss.hpp index 2f654fa..9e9cc94 100644 --- a/hss.hpp +++ b/hss.hpp @@ -1,3 +1,5 @@ +#ifndef _HSS_HPP +#define _HSS_HPP #include #include #include @@ -6,8 +8,9 @@ namespace HSS { -inline void run(QBiIPC& ipc, const std::string& file) { - if (fork() == 0) { +inline pid_t run(QBiIPC& ipc, const std::string& file) { + auto pid = fork(); + if (pid == 0) { execlp("HSSChildLauncher", "child", std::to_string(ipc.out.get_in()).c_str(), std::to_string(ipc.out.get_out()).c_str(), @@ -18,5 +21,7 @@ inline void run(QBiIPC& ipc, const std::string& file) { std::cerr << "Failed to run HSSChildLauncher" << std::endl; abort(); } + return pid; } } +#endif