summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2016-01-26 20:29:01 +0100
committerSteven Barth <steven@midlink.org>2016-01-26 20:29:01 +0100
commit4f9eded5cff092772fdc2bdeafc8647dae826390 (patch)
treea73a6dd703e80e0bdfa8cc239e445c60dde92aa3
parentdc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9 (diff)
parente23f12f59182bec966c79c65dec034b8084ff8db (diff)
downloadodhcp6c-4f9eded5cff092772fdc2bdeafc8647dae826390.tar.gz
Merge pull request #40 from dedeckeh/bugfixes
script: Launch script with correct action if last script call is terminated
-rw-r--r--src/script.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script.c b/src/script.c
index 3d313cf..f272c19 100644
--- a/src/script.c
+++ b/src/script.c
@@ -353,13 +353,15 @@ static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len
void script_call(const char *status, int delay, bool resume)
{
time_t now = odhcp6c_get_milli_time() / 1000;
+ bool running_script = false;
if (running) {
kill(running, SIGTERM);
delay -= now - started;
+ running_script = true;
}
- if (resume || !action[0])
+ if (resume || !running_script || !action[0])
strncpy(action, status, sizeof(action) - 1);
pid_t pid = fork();