diff options
author | Saúl Ibarra Corretgé <saghul@gmail.com> | 2015-06-03 21:18:55 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-06-04 00:09:05 +0200 |
commit | aa33db32380fe05a3bc7a2e320bbf63a6adddf08 (patch) | |
tree | 6794c5f2c1a46e1e319f50860bf4b7d558b24587 /deps/uv/src/unix/freebsd.c | |
parent | a804026c9b5b9f8d6316fd5e9fdb9f96f7e1c6b3 (diff) | |
download | android-node-v8-aa33db32380fe05a3bc7a2e320bbf63a6adddf08.tar.gz android-node-v8-aa33db32380fe05a3bc7a2e320bbf63a6adddf08.tar.bz2 android-node-v8-aa33db32380fe05a3bc7a2e320bbf63a6adddf08.zip |
deps: update libuv to version 1.6.0
Fixes: https://github.com/joyent/node/issues/9310
PR-URL: https://github.com/nodejs/io.js/pull/1889
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/freebsd.c')
-rw-r--r-- | deps/uv/src/unix/freebsd.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/deps/uv/src/unix/freebsd.c b/deps/uv/src/unix/freebsd.c index 2dbb1ec169..44976f7fe2 100644 --- a/deps/uv/src/unix/freebsd.c +++ b/deps/uv/src/unix/freebsd.c @@ -151,7 +151,7 @@ void uv_loadavg(double avg[3]) { char** uv_setup_args(int argc, char** argv) { - process_title = argc ? strdup(argv[0]) : NULL; + process_title = argc ? uv__strdup(argv[0]) : NULL; return argv; } @@ -159,8 +159,8 @@ char** uv_setup_args(int argc, char** argv) { int uv_set_process_title(const char* title) { int oid[4]; - if (process_title) free(process_title); - process_title = strdup(title); + if (process_title) uv__free(process_title); + process_title = uv__strdup(title); oid[0] = CTL_KERN; oid[1] = KERN_PROC; @@ -271,7 +271,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0)) return -errno; - *cpu_infos = malloc(numcpus * sizeof(**cpu_infos)); + *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos)); if (!(*cpu_infos)) return -ENOMEM; @@ -279,7 +279,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { size = sizeof(cpuspeed); if (sysctlbyname("hw.clockrate", &cpuspeed, &size, NULL, 0)) { - SAVE_ERRNO(free(*cpu_infos)); + SAVE_ERRNO(uv__free(*cpu_infos)); return -errno; } @@ -288,21 +288,21 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { */ size = sizeof(maxcpus); if (sysctlbyname(maxcpus_key, &maxcpus, &size, NULL, 0)) { - SAVE_ERRNO(free(*cpu_infos)); + SAVE_ERRNO(uv__free(*cpu_infos)); return -errno; } size = maxcpus * CPUSTATES * sizeof(long); - cp_times = malloc(size); + cp_times = uv__malloc(size); if (cp_times == NULL) { - free(*cpu_infos); + uv__free(*cpu_infos); return -ENOMEM; } if (sysctlbyname(cptimes_key, cp_times, &size, NULL, 0)) { - SAVE_ERRNO(free(cp_times)); - SAVE_ERRNO(free(*cpu_infos)); + SAVE_ERRNO(uv__free(cp_times)); + SAVE_ERRNO(uv__free(*cpu_infos)); return -errno; } @@ -315,13 +315,13 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { cpu_info->cpu_times.idle = (uint64_t)(cp_times[CP_IDLE+cur]) * multiplier; cpu_info->cpu_times.irq = (uint64_t)(cp_times[CP_INTR+cur]) * multiplier; - cpu_info->model = strdup(model); + cpu_info->model = uv__strdup(model); cpu_info->speed = cpuspeed; cur+=CPUSTATES; } - free(cp_times); + uv__free(cp_times); return 0; } @@ -330,10 +330,10 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { int i; for (i = 0; i < count; i++) { - free(cpu_infos[i].model); + uv__free(cpu_infos[i].model); } - free(cpu_infos); + uv__free(cpu_infos); } @@ -359,7 +359,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { (*count)++; } - *addresses = malloc(*count * sizeof(**addresses)); + *addresses = uv__malloc(*count * sizeof(**addresses)); if (!(*addresses)) return -ENOMEM; @@ -379,7 +379,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { if (ent->ifa_addr->sa_family == AF_LINK) continue; - address->name = strdup(ent->ifa_name); + address->name = uv__strdup(ent->ifa_name); if (ent->ifa_addr->sa_family == AF_INET6) { address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr); @@ -428,8 +428,8 @@ void uv_free_interface_addresses(uv_interface_address_t* addresses, int i; for (i = 0; i < count; i++) { - free(addresses[i].name); + uv__free(addresses[i].name); } - free(addresses); + uv__free(addresses); } |