]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/cgroup: no need to handle empty bind_network_interface
authorMike Yuan <me@yhndnzj.com>
Wed, 24 Dec 2025 18:22:07 +0000 (19:22 +0100)
committerMike Yuan <me@yhndnzj.com>
Sat, 27 Dec 2025 22:47:55 +0000 (23:47 +0100)
We always normalize empty setting to NULL, hence per our usual
coding style a simply NULL check would suffice.

src/core/cgroup.c

index a9dde6ce9d2a13e3a5cf56ab1da4fbc6d0e3ada5..89257724379451216258f20739f0de45662e1f79 100644 (file)
@@ -571,7 +571,7 @@ void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) {
                 fprintf(f, "%sDelegateSubgroup: %s\n",
                         prefix, c->delegate_subgroup);
 
-        if (!isempty(c->bind_network_interface))
+        if (c->bind_network_interface)
                 fprintf(f, "%sBindNetworkInterface: %s\n",
                         prefix, c->bind_network_interface);
 
@@ -1698,7 +1698,7 @@ static bool unit_get_needs_bind_network_interface(Unit *u) {
         if (!c)
                 return false;
 
-        return !isempty(c->bind_network_interface);
+        return c->bind_network_interface;
 }
 
 static CGroupMask unit_get_cgroup_mask(Unit *u) {