diff options
author | Brad King <brad.king@kitware.com> | 2018-05-08 12:34:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-05-08 12:34:51 (GMT) |
commit | 65431c727b53ff092ad6f2f8c081982bdde52385 (patch) | |
tree | c2d84c39997e27f28b54d6722ea52721895a8352 /Utilities/cmlibuv/src/unix/netbsd.c | |
parent | d165fd1727c1fdf540f1759583b84110bdc4a2a3 (diff) | |
parent | 0d389d175a1c40ac0ae822e1cc638cf15f05a0ce (diff) | |
download | CMake-65431c727b53ff092ad6f2f8c081982bdde52385.zip CMake-65431c727b53ff092ad6f2f8c081982bdde52385.tar.gz CMake-65431c727b53ff092ad6f2f8c081982bdde52385.tar.bz2 |
Merge topic 'update-libuv'
0d389d175a libuv: Revert local linux/sparc64 fix now that we have upstream fix
42fbb28516 Merge branch 'upstream-libuv' into update-libuv
c8b67ea119 libuv 2018-05-06 (bf605bd7)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2049
Diffstat (limited to 'Utilities/cmlibuv/src/unix/netbsd.c')
-rw-r--r-- | Utilities/cmlibuv/src/unix/netbsd.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Utilities/cmlibuv/src/unix/netbsd.c b/Utilities/cmlibuv/src/unix/netbsd.c index 7425072..2605c11 100644 --- a/Utilities/cmlibuv/src/unix/netbsd.c +++ b/Utilities/cmlibuv/src/unix/netbsd.c @@ -82,7 +82,7 @@ int uv_exepath(char* buffer, size_t* size) { int mib[4]; if (buffer == NULL || size == NULL || *size == 0) - return -EINVAL; + return UV_EINVAL; mib[0] = CTL_KERN; mib[1] = KERN_PROC_ARGS; @@ -91,7 +91,7 @@ int uv_exepath(char* buffer, size_t* size) { int_size = ARRAY_SIZE(int_buf); if (sysctl(mib, 4, int_buf, &int_size, NULL, 0)) - return -errno; + return UV__ERR(errno); /* Copy string from the intermediate buffer to outer one with appropriate * length. @@ -111,7 +111,7 @@ uint64_t uv_get_free_memory(void) { int which[] = {CTL_VM, VM_UVMEXP}; if (sysctl(which, 2, &info, &size, NULL, 0)) - return -errno; + return UV__ERR(errno); return (uint64_t) info.free * sysconf(_SC_PAGESIZE); } @@ -128,7 +128,7 @@ uint64_t uv_get_total_memory(void) { size_t size = sizeof(info); if (sysctl(which, 2, &info, &size, NULL, 0)) - return -errno; + return UV__ERR(errno); return (uint64_t) info; } @@ -150,7 +150,7 @@ int uv_set_process_title(const char* title) { if (process_title == NULL) { uv_mutex_unlock(&process_title_mutex); - return -ENOMEM; + return UV_ENOMEM; } uv__free(process_title); @@ -167,7 +167,7 @@ int uv_get_process_title(char* buffer, size_t size) { size_t len; if (buffer == NULL || size == 0) - return -EINVAL; + return UV_EINVAL; uv_once(&process_title_mutex_once, init_process_title_mutex_once); uv_mutex_lock(&process_title_mutex); @@ -177,7 +177,7 @@ int uv_get_process_title(char* buffer, size_t size) { if (size < len) { uv_mutex_unlock(&process_title_mutex); - return -ENOBUFS; + return UV_ENOBUFS; } memcpy(buffer, process_title, len); @@ -219,7 +219,7 @@ int uv_resident_set_memory(size_t* rss) { error: if (kd) kvm_close(kd); - return -EPERM; + return UV_EPERM; } @@ -230,7 +230,7 @@ int uv_uptime(double* uptime) { static int which[] = {CTL_KERN, KERN_BOOTTIME}; if (sysctl(which, 2, &info, &size, NULL, 0)) - return -errno; + return UV__ERR(errno); now = time(NULL); @@ -254,12 +254,12 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { size = sizeof(model); if (sysctlbyname("machdep.cpu_brand", &model, &size, NULL, 0) && sysctlbyname("hw.model", &model, &size, NULL, 0)) { - return -errno; + return UV__ERR(errno); } size = sizeof(numcpus); if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0)) - return -errno; + return UV__ERR(errno); *count = numcpus; /* Only i386 and amd64 have machdep.tsc_freq */ @@ -270,16 +270,16 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { size = numcpus * CPUSTATES * sizeof(*cp_times); cp_times = uv__malloc(size); if (cp_times == NULL) - return -ENOMEM; + return UV_ENOMEM; if (sysctlbyname("kern.cp_time", cp_times, &size, NULL, 0)) - return -errno; + return UV__ERR(errno); *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos)); if (!(*cpu_infos)) { uv__free(cp_times); uv__free(*cpu_infos); - return -ENOMEM; + return UV_ENOMEM; } for (i = 0; i < numcpus; i++) { |