summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/aix-common.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-11-12 23:59:52 -0500
committercjihrig <cjihrig@gmail.com>2018-11-15 14:52:55 -0500
commit9cef7b84b1f6b1e116afaad945f31b368e8917e2 (patch)
tree333273bbf34a23e65deea4a85d009b75f2f77e4d /deps/uv/src/unix/aix-common.c
parent1ddcccb7e379089ac47b87d772343e16fd84c1c8 (diff)
downloadandroid-node-v8-9cef7b84b1f6b1e116afaad945f31b368e8917e2.tar.gz
android-node-v8-9cef7b84b1f6b1e116afaad945f31b368e8917e2.tar.bz2
android-node-v8-9cef7b84b1f6b1e116afaad945f31b368e8917e2.zip
deps: upgrade to libuv 1.24.0
PR-URL: https://github.com/nodejs/node/pull/24332 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/aix-common.c')
-rw-r--r--deps/uv/src/unix/aix-common.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/uv/src/unix/aix-common.c b/deps/uv/src/unix/aix-common.c
index e17e449481..63ac16a034 100644
--- a/deps/uv/src/unix/aix-common.c
+++ b/deps/uv/src/unix/aix-common.c
@@ -166,8 +166,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
}
-int uv_interface_addresses(uv_interface_address_t** addresses,
- int* count) {
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
uv_interface_address_t* address;
int sockfd, inet6, size = 1;
struct ifconf ifc;
@@ -175,6 +174,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
struct sockaddr_dl* sa_addr;
*count = 0;
+ *addresses = NULL;
if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) {
return UV__ERR(errno);
@@ -217,6 +217,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
(*count)++;
}
+ if (*count == 0) {
+ uv__close(sockfd);
+ return 0;
+ }
+
/* Alloc the return interface structs */
*addresses = uv__malloc(*count * sizeof(uv_interface_address_t));
if (!(*addresses)) {
@@ -289,4 +294,4 @@ void uv_free_interface_addresses(uv_interface_address_t* addresses,
}
uv__free(addresses);
-} \ No newline at end of file
+}