]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make route_configure() return 0 on success
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 20 Oct 2020 05:20:19 +0000 (14:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 20 Oct 2020 05:20:22 +0000 (14:20 +0900)
Previously, route_configure() always returns 1 on success, and never
returns 0. It is not necessary to return positive value.

src/network/networkd-route.c

index 707660df3c0d4ee280f9c3de82fc3244a2418bc6..4ad9adc920262737761986e5311fe08662d32510 100644 (file)
@@ -1130,7 +1130,7 @@ int route_configure(
                 }
         }
 
-        return 1;
+        return 0;
 }
 
 static int route_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
@@ -1201,8 +1201,8 @@ int link_set_routes(Link *link) {
                         r = route_configure(rt, link, route_handler, NULL);
                         if (r < 0)
                                 return log_link_warning_errno(link, r, "Could not set routes: %m");
-                        if (r > 0)
-                                link->route_messages++;
+
+                        link->route_messages++;
                 }
 
         if (link->route_messages == 0) {