core/timer: drop unnecessary brackets

This commit is contained in:
Yu Watanabe 2020-11-26 09:27:05 +09:00
parent dca63b5b46
commit 2762ce2d89
1 changed files with 3 additions and 8 deletions

View File

@ -101,14 +101,13 @@ static int timer_add_default_dependencies(Timer *t) {
if (r < 0)
return r;
LIST_FOREACH(value, v, t->values) {
LIST_FOREACH(value, v, t->values)
if (v->base == TIMER_CALENDAR) {
r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, SPECIAL_TIME_SYNC_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
if (r < 0)
return r;
break;
}
}
}
return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
@ -259,8 +258,7 @@ static void timer_dump(Unit *u, FILE *f, const char *prefix) {
prefix, yes_no(t->on_clock_change),
prefix, yes_no(t->on_timezone_change));
LIST_FOREACH(value, v, t->values) {
LIST_FOREACH(value, v, t->values)
if (v->base == TIMER_CALENDAR) {
_cleanup_free_ char *p = NULL;
@ -280,7 +278,6 @@ static void timer_dump(Unit *u, FILE *f, const char *prefix) {
timer_base_to_string(v->base),
format_timespan(timespan1, sizeof(timespan1), v->value, 0));
}
}
}
static void timer_set_state(Timer *t, TimerState state) {
@ -670,9 +667,7 @@ static int timer_start(Unit *u) {
}
} else if (errno == ENOENT)
/* The timer has never run before,
* make sure a stamp file exists.
*/
/* The timer has never run before, make sure a stamp file exists. */
(void) touch_file(t->stamp_path, true, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
}