mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-12 08:58:20 +03:00
pid1: get rid of unit_supported() helper
Another case where "open code" is easier to read than the helper.
This commit is contained in:
parent
3c4e303136
commit
96cf3ec966
@ -1791,7 +1791,7 @@ int unit_start(Unit *u) {
|
|||||||
* condition checks, so that we rather return condition check errors (which are usually not
|
* condition checks, so that we rather return condition check errors (which are usually not
|
||||||
* considered a true failure) than "not supported" errors (which are considered a failure).
|
* considered a true failure) than "not supported" errors (which are considered a failure).
|
||||||
*/
|
*/
|
||||||
if (!unit_supported(u))
|
if (!unit_type_supported(u->type))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
/* Let's make sure that the deps really are in order before we start this. Normally the job engine
|
/* Let's make sure that the deps really are in order before we start this. Normally the job engine
|
||||||
@ -1826,7 +1826,7 @@ bool unit_can_start(Unit *u) {
|
|||||||
if (u->load_state != UNIT_LOADED)
|
if (u->load_state != UNIT_LOADED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!unit_supported(u))
|
if (!unit_type_supported(u->type))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Scope units may be started only once */
|
/* Scope units may be started only once */
|
||||||
@ -1875,7 +1875,7 @@ int unit_stop(Unit *u) {
|
|||||||
bool unit_can_stop(Unit *u) {
|
bool unit_can_stop(Unit *u) {
|
||||||
assert(u);
|
assert(u);
|
||||||
|
|
||||||
if (!unit_supported(u))
|
if (!unit_type_supported(u->type))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (u->perpetual)
|
if (u->perpetual)
|
||||||
|
@ -800,10 +800,6 @@ bool unit_is_unneeded(Unit *u);
|
|||||||
pid_t unit_control_pid(Unit *u);
|
pid_t unit_control_pid(Unit *u);
|
||||||
pid_t unit_main_pid(Unit *u);
|
pid_t unit_main_pid(Unit *u);
|
||||||
|
|
||||||
static inline bool unit_supported(Unit *u) {
|
|
||||||
return unit_type_supported(u->type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void unit_warn_if_dir_nonempty(Unit *u, const char* where);
|
void unit_warn_if_dir_nonempty(Unit *u, const char* where);
|
||||||
int unit_fail_if_noncanonical(Unit *u, const char* where);
|
int unit_fail_if_noncanonical(Unit *u, const char* where);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user