diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-04-30 01:29:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-04-30 01:29:00 +0200 |
commit | 1c2e9646e4a1720fc8ad35c705c195ae1a2c5ce0 (patch) | |
tree | 3d7f61210c0b45fb1f1fa61629c2b5825a0c43e9 /src/core/unit.h | |
parent | 524d896ac17518b824b2c94b3b0b2a23c23da08f (diff) |
core: simplify unit type detection logic
Introduce a new call unit_type_supported() and make use of it
everywhere.
Also, drop Manager parameter from per-type supported method prototype.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r-- | src/core/unit.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/unit.h b/src/core/unit.h index 1a44271bc6..31b12157c2 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -402,7 +402,7 @@ struct UnitVTable { /* If this function is set and return false all jobs for units * of this type will immediately fail. */ - bool (*supported)(Manager *m); + bool (*supported)(void); /* The interface name */ const char *bus_interface; @@ -601,6 +601,12 @@ int unit_make_transient(Unit *u); int unit_require_mounts_for(Unit *u, const char *path); +bool unit_type_supported(UnitType t); + +static inline bool unit_supported(Unit *u) { + return unit_type_supported(u->type); +} + const char *unit_active_state_to_string(UnitActiveState i) _const_; UnitActiveState unit_active_state_from_string(const char *s) _pure_; |