From 7ad5c58d0ee7f3475edea7503f595959c28912c2 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 11 Jun 2019 16:41:33 +0000 Subject: [PATCH] exec: start executable in exec_prepare() rather than exec_start() --- lib/nodes/exec.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/nodes/exec.cpp b/lib/nodes/exec.cpp index 158ae93a9..7d7623947 100644 --- a/lib/nodes/exec.cpp +++ b/lib/nodes/exec.cpp @@ -74,6 +74,10 @@ int exec_prepare(struct node *n) if (ret) return ret; + /* Start subprocess */ + e->proc = std::make_unique(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(e->command); - debug(2, "Started sub-process with pid=%d", e->proc->getPid()); +// struct exec *e = (struct exec *) n->_vd; return 0; }