]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
install: move and rename to lowercase two functions
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2017 16:36:45 +0000 (18:36 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2017 16:36:45 +0000 (18:36 +0200)
No reason to make them look like macros.

src/shared/install.c
src/shared/install.h

index 9e4e0eaf6fd7a89cc33ad5a57605a7486e4b4c82..d73727e403e616b66e462d116504e6a7b5ca007e 100644 (file)
@@ -83,6 +83,20 @@ typedef struct {
         size_t n_rules;
 } Presets;
 
+static inline bool unit_file_install_info_has_rules(UnitFileInstallInfo *i) {
+        assert(i);
+
+        return !strv_isempty(i->aliases) ||
+               !strv_isempty(i->wanted_by) ||
+               !strv_isempty(i->required_by);
+}
+
+static inline bool unit_file_install_info_has_also(UnitFileInstallInfo *i) {
+        assert(i);
+
+        return !strv_isempty(i->also);
+}
+
 static inline void presets_freep(Presets *p) {
         size_t i;
 
@@ -2593,9 +2607,9 @@ static int unit_file_lookup_state(
                 if (r < 0)
                         return r;
                 if (r == 0) {
-                        if (UNIT_FILE_INSTALL_INFO_HAS_RULES(i))
+                        if (unit_file_install_info_has_rules(i))
                                 state = UNIT_FILE_DISABLED;
-                        else if (UNIT_FILE_INSTALL_INFO_HAS_ALSO(i))
+                        else if (unit_file_install_info_has_also(i))
                                 state = UNIT_FILE_INDIRECT;
                         else
                                 state = UNIT_FILE_STATIC;
index 7a5859e72950966c76f2e67cca630d59fbad72d3..c1fcbe96ed107be85e2d0f00a1204af6b1da6f8b 100644 (file)
@@ -132,20 +132,6 @@ struct UnitFileInstallInfo {
         bool auxiliary;
 };
 
-static inline bool UNIT_FILE_INSTALL_INFO_HAS_RULES(UnitFileInstallInfo *i) {
-        assert(i);
-
-        return !strv_isempty(i->aliases) ||
-               !strv_isempty(i->wanted_by) ||
-               !strv_isempty(i->required_by);
-}
-
-static inline bool UNIT_FILE_INSTALL_INFO_HAS_ALSO(UnitFileInstallInfo *i) {
-        assert(i);
-
-        return !strv_isempty(i->also);
-}
-
 bool unit_type_may_alias(UnitType type) _const_;
 bool unit_type_may_template(UnitType type) _const_;