libsystemd-network: make sd_dhcp_client_get_ifname() or friends return negative errno on error
This commit is contained in:
@@ -3,16 +3,13 @@
|
||||
#include "format-util.h"
|
||||
#include "network-common.h"
|
||||
|
||||
const char *get_ifname(int ifindex, char **ifname) {
|
||||
int get_ifname(int ifindex, char **ifname) {
|
||||
assert(ifname);
|
||||
|
||||
/* This sets ifname only when it is not set yet. */
|
||||
|
||||
if (*ifname)
|
||||
return *ifname;
|
||||
return 0;
|
||||
|
||||
if (format_ifname_alloc(ifindex, ifname) < 0)
|
||||
return NULL;
|
||||
|
||||
return *ifname;
|
||||
return format_ifname_alloc(ifindex, ifname);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user