mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: return empty set on ENOSYS for interfaces
If node was compiled with --no-ifaddrs to support older operating systems, don't throw instead simply return an empty object Fixes #6846
This commit is contained in:
1 parent
196184d332
commit
8753bb3859
1 file changed
+5
-2
+5
-2
@@ -207,11 +207,14 @@ static Handle<Value> GetInterfaceAddresses(const Arguments& args) {
|
||||
|
||||
uv_err_t err = uv_interface_addresses(&interfaces, &count);
|
||||
|
||||
ret = Object::New();
|
||||
|
||||
if (err.code == UV_ENOSYS)
|
||||
return scope.Close(ret);
|
||||
|
||||
if (err.code != UV_OK)
|
||||
return ThrowException(UVException(err.code, "uv_interface_addresses"));
|
||||
|
||||
ret = Object::New();
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
name = String::New(interfaces[i].name);
|
||||
if (ret->Has(name)) {
|
||||
|
||||
Reference in new issue
Block a user