core: introduce exit_status_set_is_empty() to make things a bit easier to read
This commit is contained in:
parent
ce4a52a500
commit
55ebf98cbe
|
@ -335,7 +335,7 @@ static int service_verify(Service *s) {
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s->type == SERVICE_ONESHOT && !(set_isempty(s->restart_force_status.signal) && set_isempty(s->restart_force_status.status))) {
|
||||
if (s->type == SERVICE_ONESHOT && !exit_status_set_is_empty(&s->restart_force_status)) {
|
||||
log_error_unit(UNIT(s)->id, "%s has RestartForceStatus= set, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -216,3 +216,10 @@ void exit_status_set_free(ExitStatusSet *x) {
|
|||
set_free(x->signal);
|
||||
x->status = x->signal = NULL;
|
||||
}
|
||||
|
||||
bool exit_status_set_is_empty(ExitStatusSet *x) {
|
||||
if (!x)
|
||||
return true;
|
||||
|
||||
return set_isempty(x->status) && set_isempty(x->signal);
|
||||
}
|
||||
|
|
|
@ -97,3 +97,4 @@ bool is_clean_exit(int code, int status, ExitStatusSet *success_status);
|
|||
bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status);
|
||||
|
||||
void exit_status_set_free(ExitStatusSet *x);
|
||||
bool exit_status_set_is_empty(ExitStatusSet *x);
|
||||
|
|
Loading…
Reference in a new issue