diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-05-04 10:46:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-05-04 10:46:13 +0200 |
commit | 1ed7ebcfcaa952441565c1c8c43084add1f58a89 (patch) | |
tree | 9c2a3a4e826c8a0ebab05562d66b7070a3274dc6 /src/core/timer.c | |
parent | d428dd6ac9a56e7b3421fb8ef3aac9937a4a2e62 (diff) | |
parent | dbb0578edc5ab8e11641c8b2d29904d4f5f8e1e6 (diff) |
Merge pull request #3170 from poettering/v230-preparation-fixes
make virtualization detection quieter, rework unit start limit logic, detect unit file drop-in changes correctly, fix autofs state propagation
Diffstat (limited to 'src/core/timer.c')
-rw-r--r-- | src/core/timer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/timer.c b/src/core/timer.c index f8f5f4b2e4..3206296f09 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -599,6 +599,7 @@ static int timer_start(Unit *u) { Timer *t = TIMER(u); TimerValue *v; Unit *trigger; + int r; assert(t); assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED); @@ -609,6 +610,12 @@ static int timer_start(Unit *u) { return -ENOENT; } + r = unit_start_limit_test(u); + if (r < 0) { + timer_enter_dead(t, TIMER_FAILURE_START_LIMIT_HIT); + return r; + } + t->last_trigger = DUAL_TIMESTAMP_NULL; /* Reenable all timers that depend on unit activation time */ @@ -808,7 +815,8 @@ DEFINE_STRING_TABLE_LOOKUP(timer_base, TimerBase); static const char* const timer_result_table[_TIMER_RESULT_MAX] = { [TIMER_SUCCESS] = "success", - [TIMER_FAILURE_RESOURCES] = "resources" + [TIMER_FAILURE_RESOURCES] = "resources", + [TIMER_FAILURE_START_LIMIT_HIT] = "start-limit-hit", }; DEFINE_STRING_TABLE_LOOKUP(timer_result, TimerResult); |