mirror of
https://gitlab.com/niansa/libhss.git
synced 2025-03-06 20:49:21 +01:00
Fixed problem when including hss.hpp more than once
This commit is contained in:
parent
db8f46c6b1
commit
4a7b66635d
1 changed files with 7 additions and 2 deletions
9
hss.hpp
9
hss.hpp
|
@ -1,3 +1,5 @@
|
|||
#ifndef _HSS_HPP
|
||||
#define _HSS_HPP
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue