diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-29 21:05:36 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-29 21:06:28 +0100 |
commit | fdce7817b9a27a370c01b7dd9da6a84fcae1038e (patch) | |
tree | 99a43024f3feac99137488f3d043ae3ed1fc8ea9 /src/network/networkctl.c | |
parent | f119082e7a1ccfbf50c30a99819b6e303cdf09a1 (diff) | |
download | systemd-fdce7817b9a27a370c01b7dd9da6a84fcae1038e.tar.gz |
networkd: clean up link_get_type_string
The return value is always ignored, so get rid of it.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r-- | src/network/networkctl.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 8a08304240..7b33e0db17 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -56,7 +56,7 @@ static bool arg_no_pager = false; static bool arg_legend = true; static bool arg_all = false; -static int link_get_type_string(unsigned short iftype, sd_device *d, char **ret) { +static void link_get_type_string(unsigned short iftype, sd_device *d, char **ret) { const char *t; char *p; @@ -69,27 +69,25 @@ static int link_get_type_string(unsigned short iftype, sd_device *d, char **ret) if (!isempty(devtype)) { p = strdup(devtype); if (!p) - return -ENOMEM; + return; *ret = p; - return 1; + return; } } t = arphrd_to_name(iftype); if (!t) { *ret = NULL; - return 0; + return; } p = strdup(t); if (!p) - return -ENOMEM; + return; ascii_strlower(p); *ret = p; - - return 0; } static void operational_state_to_color(const char *state, const char **on, const char **off) { @@ -314,7 +312,7 @@ static int list_links(int argc, char *argv[], void *userdata) { xsprintf(devid, "n%i", links[i].ifindex); (void) sd_device_new_from_device_id(&d, devid); - (void) link_get_type_string(links[i].iftype, d, &t); + link_get_type_string(links[i].iftype, d, &t); printf("%3i %-16s %-18s %s%-11s%s %s%-10s%s\n", links[i].ifindex, links[i].name, strna(t), @@ -807,7 +805,7 @@ static int link_status_one( (void) sd_device_get_property_value(d, "ID_MODEL", &model); } - (void) link_get_type_string(info->iftype, d, &t); + link_get_type_string(info->iftype, d, &t); (void) sd_network_link_get_network_file(info->ifindex, &network); |