getifaddrs: don't fail if there are no interfaces.
* This is not an error, just return an empty list. * Same behavior as *BSD implementation.
This commit is contained in:
parent
2df7158917
commit
f93dab03ec
@ -78,8 +78,9 @@ getifaddrs(struct ifaddrs** _ifaddrs)
|
||||
|
||||
size_t count = (size_t)config.ifc_value;
|
||||
if (count == 0) {
|
||||
errno = B_BAD_VALUE;
|
||||
return -1;
|
||||
// No interfaces found
|
||||
*_ifaddrs = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Allocate a buffer for ifreqs for all interfaces
|
||||
|
Loading…
Reference in New Issue
Block a user