summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-01-12 10:04:21 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-01-12 10:04:21 -0800
commit8753bb38596f7148d0cf60b8c1ccad7db4eef609 (patch)
treef8061ab9c622ec31e3616c4c7433ed5c2e20e53b
parent196184d332ba2d2defc56ad0b37653659a7d3ec0 (diff)
downloadnode-8753bb38596f7148d0cf60b8c1ccad7db4eef609.tar.gz
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
-rw-r--r--src/node_os.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/node_os.cc b/src/node_os.cc
index 4b325d820..07f73f4b7 100644
--- a/src/node_os.cc
+++ b/src/node_os.cc
@@ -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)) {