diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-12-18 13:54:13 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-01-11 12:06:08 +0100 |
commit | 597da51bae9e46a93b310125174d48c9438d3bab (patch) | |
tree | db481a70aa76af1d7b02ed8f8ae5792e883645d8 /src/nspawn | |
parent | initctl: (void)ify epoll_ctl() (diff) | |
download | systemd-597da51bae9e46a93b310125174d48c9438d3bab.tar.xz systemd-597da51bae9e46a93b310125174d48c9438d3bab.zip |
tree-wide: make parse_ifindex simply return the index
We don't need a seperate output parameter that is of type int. glibc() says
that the type is "unsigned", but the kernel thinks it's "int". And the
"alternative names" interface also uses ints. So let's standarize on ints,
since it's clearly not realisitic to have interface numbers in the upper half
of unsigned int range.
Diffstat (limited to 'src/nspawn')
-rw-r--r-- | src/nspawn/nspawn-network.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c index 9c9cf4812e..b2592b023d 100644 --- a/src/nspawn/nspawn-network.c +++ b/src/nspawn/nspawn-network.c @@ -337,9 +337,9 @@ static int join_bridge(sd_netlink *rtnl, const char *veth_name, const char *brid assert(veth_name); assert(bridge_name); - r = parse_ifindex_or_ifname(bridge_name, &bridge_ifi); - if (r < 0) - return r; + bridge_ifi = parse_ifindex_or_ifname(bridge_name); + if (bridge_ifi < 0) + return bridge_ifi; r = sd_rtnl_message_new_link(rtnl, &m, RTM_SETLINK, 0); if (r < 0) @@ -473,11 +473,11 @@ int remove_bridge(const char *bridge_name) { } static int parse_interface(const char *name) { - int ifi, r; + int ifi; - r = parse_ifindex_or_ifname(name, &ifi); - if (r < 0) - return log_error_errno(r, "Failed to resolve interface %s: %m", name); + ifi = parse_ifindex_or_ifname(name); + if (ifi < 0) + return log_error_errno(ifi, "Failed to resolve interface %s: %m", name); return ifi; } |