]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit-file: make unit_type_may_{alias_template} static inline
authorMike Yuan <me@yhndnzj.com>
Thu, 19 Sep 2024 11:53:25 +0000 (13:53 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 6 Oct 2024 17:27:11 +0000 (19:27 +0200)
src/shared/unit-file.c
src/shared/unit-file.h

index ca2686b2099576dfdce94978c5ee5fb1d659ba28..5bb580285cc0e58e82be7a9632663ad5668a8619 100644 (file)
 #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;
index 1c43861f005df80c8aca48f2fd7fb4bc4aebb302..1c89a92c7d9f0a89b07d299ff2affaa0f609e0d5 100644 (file)
@@ -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);