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:
Timothy J Fontaine committed 2014-01-12 10:04:21 -08:00
1 parent 196184d332
commit 8753bb3859
1 file changed
+5 -2
+5 -2
View File
@@ -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)) {