1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

exec: start executable in exec_prepare() rather than exec_start()

This commit is contained in:
Steffen Vogel 2019-06-11 16:41:33 +00:00
parent b3dc60e605
commit 7ad5c58d0e

View file

@ -74,6 +74,10 @@ int exec_prepare(struct node *n)
if (ret)
return ret;
/* Start subprocess */
e->proc = std::make_unique<Popen>(e->command);
debug(2, "Started sub-process with pid=%d", e->proc->getPid());
return 0;
}
@ -91,11 +95,7 @@ int exec_destroy(struct node *n)
int exec_start(struct node *n)
{
struct exec *e = (struct exec *) n->_vd;
/* Start subprocess */
e->proc = std::make_unique<Popen>(e->command);
debug(2, "Started sub-process with pid=%d", e->proc->getPid());
// struct exec *e = (struct exec *) n->_vd;
return 0;
}