projects
/
project
/
odhcp6c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
473f248
)
script: fix possible negative delay
author
Hans Dedecker
<dedeckeh@gmail.com>
Thu, 5 Apr 2018 14:51:19 +0000
(16:51 +0200)
committer
Hans Dedecker
<dedeckeh@gmail.com>
Thu, 5 Apr 2018 16:22:00 +0000
(18:22 +0200)
Fix delay becoming negative when killing a running script
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/script.c
patch
|
blob
|
history
diff --git
a/src/script.c
b/src/script.c
index 5696b7f9c955308a542e63af50095b50b21e9f19..fcdbb276b88bac082a574e626972cf01f31ff44f 100644
(file)
--- a/
src/script.c
+++ b/
src/script.c
@@
-393,8
+393,15
@@
void script_call(const char *status, int delay, bool resume)
bool running_script = false;
if (running) {
+ time_t diff = now - started;
+
kill(running, SIGTERM);
- delay -= now - started;
+
+ if (diff > delay)
+ delay -= diff;
+ else
+ delay = 0;
+
running_script = true;
}