chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: fix detection of active units
[elogind.git]
/
src
/
timer.c
diff --git
a/src/timer.c
b/src/timer.c
index 7bf2d1023892338488261ea23399d6a8dd385ded..f0005f55ce364a9378f0e7d6800a5d39cb010e8d 100644
(file)
--- a/
src/timer.c
+++ b/
src/timer.c
@@
-31,7
+31,7
@@
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
[TIMER_WAITING] = UNIT_ACTIVE,
[TIMER_RUNNING] = UNIT_ACTIVE,
[TIMER_ELAPSED] = UNIT_ACTIVE,
[TIMER_WAITING] = UNIT_ACTIVE,
[TIMER_RUNNING] = UNIT_ACTIVE,
[TIMER_ELAPSED] = UNIT_ACTIVE,
- [TIMER_MAINTENANCE] = UNIT_
INACTIV
E
+ [TIMER_MAINTENANCE] = UNIT_
MAINTENANC
E
};
static void timer_init(Unit *u) {
};
static void timer_init(Unit *u) {
@@
-60,7
+60,7
@@
static void timer_done(Unit *u) {
static int timer_verify(Timer *t) {
assert(t);
static int timer_verify(Timer *t) {
assert(t);
- if (
UNIT(t)
->meta.load_state != UNIT_LOADED)
+ if (
t
->meta.load_state != UNIT_LOADED)
return 0;
if (!t->values) {
return 0;
if (!t->values) {
@@
-258,7
+258,7
@@
static void timer_enter_running(Timer *t) {
int r;
assert(t);
int r;
assert(t);
- if ((r = manager_add_job(
UNIT(t)
->meta.manager, JOB_START, t->unit, JOB_REPLACE, true, NULL)) < 0)
+ if ((r = manager_add_job(
t
->meta.manager, JOB_START, t->unit, JOB_REPLACE, true, NULL)) < 0)
goto fail;
timer_set_state(t, TIMER_RUNNING);
goto fail;
timer_set_state(t, TIMER_RUNNING);
@@
-401,7
+401,7
@@
void timer_unit_notify(Unit *u, UnitActiveState new_state) {
case TIMER_RUNNING:
case TIMER_RUNNING:
- if (
new_state == UNIT_INACTIVE
) {
+ if (
UNIT_IS_INACTIVE_OR_MAINTENANCE(new_state)
) {
log_debug("%s got notified about unit deactivation.", t->meta.id);
timer_enter_waiting(t, false);
}
log_debug("%s got notified about unit deactivation.", t->meta.id);
timer_enter_waiting(t, false);
}