diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-09-19 13:53:25 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-10-06 19:27:11 +0200 |
commit | 1a7627f4e1058f7518e970e289ed020f3d329b22 (patch) | |
tree | 8c2dc7e0a2049fa308e062de10f1b442212a35ec /src | |
parent | basic/unit-file: move to shared/ (diff) | |
download | systemd-1a7627f4e1058f7518e970e289ed020f3d329b22.tar.xz systemd-1a7627f4e1058f7518e970e289ed020f3d329b22.zip |
unit-file: make unit_type_may_{alias_template} static inline
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/unit-file.c | 19 | ||||
-rw-r--r-- | src/shared/unit-file.h | 20 |
2 files changed, 18 insertions, 21 deletions
diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c index ca2686b209..5bb580285c 100644 --- a/src/shared/unit-file.c +++ b/src/shared/unit-file.c @@ -16,25 +16,6 @@ #include "strv.h" #include "unit-file.h" -bool unit_type_may_alias(UnitType type) { - return IN_SET(type, - UNIT_SERVICE, - UNIT_SOCKET, - UNIT_TARGET, - UNIT_DEVICE, - UNIT_TIMER, - UNIT_PATH); -} - -bool unit_type_may_template(UnitType type) { - return IN_SET(type, - UNIT_SERVICE, - UNIT_SOCKET, - UNIT_TARGET, - UNIT_TIMER, - UNIT_PATH); -} - int unit_symlink_name_compatible(const char *symlink, const char *target, bool instance_propagation) { _cleanup_free_ char *template = NULL; int r, un_type1, un_type2; diff --git a/src/shared/unit-file.h b/src/shared/unit-file.h index 1c43861f00..1c89a92c7d 100644 --- a/src/shared/unit-file.h +++ b/src/shared/unit-file.h @@ -28,8 +28,24 @@ enum UnitFileState { _UNIT_FILE_STATE_INVALID = -EINVAL, }; -bool unit_type_may_alias(UnitType type) _const_; -bool unit_type_may_template(UnitType type) _const_; +static inline bool unit_type_may_alias(UnitType type) { + return IN_SET(type, + UNIT_SERVICE, + UNIT_SOCKET, + UNIT_TARGET, + UNIT_DEVICE, + UNIT_TIMER, + UNIT_PATH); +} + +static inline bool unit_type_may_template(UnitType type) { + return IN_SET(type, + UNIT_SERVICE, + UNIT_SOCKET, + UNIT_TARGET, + UNIT_TIMER, + UNIT_PATH); +} int unit_symlink_name_compatible(const char *symlink, const char *target, bool instance_propagation); int unit_validate_alias_symlink_or_warn(int log_level, const char *filename, const char *target); |