Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 8753bb3

Browse files
committed
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
1 parent 196184d commit 8753bb3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/node_os.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,14 @@ static Handle<Value> GetInterfaceAddresses(const Arguments& args) {
207207

208208
uv_err_t err = uv_interface_addresses(&interfaces, &count);
209209

210+
ret = Object::New();
211+
212+
if (err.code == UV_ENOSYS)
213+
return scope.Close(ret);
214+
210215
if (err.code != UV_OK)
211216
return ThrowException(UVException(err.code, "uv_interface_addresses"));
212217

213-
ret = Object::New();
214-
215218
for (i = 0; i < count; i++) {
216219
name = String::New(interfaces[i].name);
217220
if (ret->Has(name)) {

0 commit comments

Comments
 (0)