assert(t);
assert(UNIT(t)->load_state == UNIT_LOADED);
- if (!t->values && !t->on_clock_change && !t->on_timezone_change) {
- log_unit_error(UNIT(t), "Timer unit lacks value setting. Refusing.");
- return -ENOEXEC;
- }
+ if (!t->values && !t->on_clock_change && !t->on_timezone_change)
+ return log_unit_error_errno(UNIT(t), SYNTHETIC_ERRNO(ENOEXEC), "Timer unit lacks value setting. Refusing.");
return 0;
}
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);
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;
timer_base_to_string(v->base),
format_timespan(timespan1, sizeof(timespan1), v->value, 0));
}
- }
}
static void timer_set_state(Timer *t, TimerState state) {
}
} 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);
}