From 8753bb38596f7148d0cf60b8c1ccad7db4eef609 Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Sun, 12 Jan 2014 10:04:21 -0800 Subject: 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 --- src/node_os.cc | 7 +++++-- 1 file 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 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)) { -- cgit v1.2.1