]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: move routing_policy_rule_read_full_file()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Aug 2020 03:27:32 +0000 (12:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Sep 2020 23:42:01 +0000 (08:42 +0900)
src/network/networkd-routing-policy-rule.c

index 36dad527d0969e501c03fc6a1b3debb9543d4606..d379a52a2d56074218b7bfabad970b064c8e002e 100644 (file)
@@ -1166,26 +1166,6 @@ int config_parse_routing_policy_rule_suppress_prefixlen(
         return 0;
 }
 
-static int routing_policy_rule_read_full_file(const char *state_file, char **ret) {
-        _cleanup_free_ char *s = NULL;
-        size_t size;
-        int r;
-
-        assert(state_file);
-
-        r = read_full_file(state_file, &s, &size);
-        if (r == -ENOENT)
-                return -ENODATA;
-        if (r < 0)
-                return r;
-        if (size <= 0)
-                return -ENODATA;
-
-        *ret = TAKE_PTR(s);
-
-        return size;
-}
-
 int routing_policy_serialize_rules(Set *rules, FILE *f) {
         RoutingPolicyRule *rule = NULL;
         Iterator i;
@@ -1303,6 +1283,26 @@ int routing_policy_serialize_rules(Set *rules, FILE *f) {
         return 0;
 }
 
+static int routing_policy_rule_read_full_file(const char *state_file, char **ret) {
+        _cleanup_free_ char *s = NULL;
+        size_t size;
+        int r;
+
+        assert(state_file);
+
+        r = read_full_file(state_file, &s, &size);
+        if (r == -ENOENT)
+                return -ENODATA;
+        if (r < 0)
+                return r;
+        if (size <= 0)
+                return -ENODATA;
+
+        *ret = TAKE_PTR(s);
+
+        return size;
+}
+
 int routing_policy_load_rules(const char *state_file, Set **rules) {
         _cleanup_strv_free_ char **l = NULL;
         _cleanup_free_ char *data = NULL;