I have a C++ program that acts as a watchdog over others. If it detects that a process is no longer running, it restarts it via system. The problem is, if I kil
system
Don't use system(...) it is not multi-threading safe.
system(...)
int pid = fork(); if(pid==0) { int rc = execv("processname", "/path/to/processConfig.xml &"); if(rc == -1) { printf(stderr, "processname failed to start. %d", errno); } ... } else { //continue with the parent }