Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'v0.8'

  • Loading branch information...
commit a416a585b25c51a3ded8be2fc7b3bf4559be7279 2 parents 34fb759 + d0816aa
@bnoordhuis bnoordhuis authored
Showing with 4 additions and 11 deletions.
  1. +1 −9 src/unix/sunos.c
  2. +1 −0  src/win/error.c
  3. +2 −2 test/test-fs.c
View
10 src/unix/sunos.c
@@ -331,14 +331,6 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
lookup_instance = 0;
while ((ksp = kstat_lookup(kc, (char *)"cpu_info", lookup_instance, NULL))) {
if (kstat_read(kc, ksp, NULL) == -1) {
- /*
- * It is deeply annoying, but some kstats can return errors
- * under otherwise routine conditions. (ACPI is one
- * offender; there are surely others.) To prevent these
- * fouled kstats from completely ruining our day, we assign
- * an "error" member to the return value that consists of
- * the strerror().
- */
cpu_info->speed = 0;
cpu_info->model = NULL;
} else {
@@ -348,7 +340,7 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
knp = (kstat_named_t *) kstat_data_lookup(ksp, (char *)"brand");
assert(knp->data_type == KSTAT_DATA_STRING);
- cpu_info->model = KSTAT_NAMED_STR_PTR(knp);
+ cpu_info->model = strdup(KSTAT_NAMED_STR_PTR(knp));
}
lookup_instance++;
View
1  src/win/error.c
@@ -86,6 +86,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_MOD_NOT_FOUND: return UV_ENOENT;
case ERROR_PATH_NOT_FOUND: return UV_ENOENT;
case ERROR_ACCESS_DENIED: return UV_EPERM;
+ case ERROR_PRIVILEGE_NOT_HELD: return UV_EPERM;
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE;
View
4 test/test-fs.c
@@ -1224,10 +1224,10 @@ TEST_IMPL(fs_symlink) {
* We just pass the test and bail out early if we get ENOTSUP.
*/
return 0;
- } else if (uv_last_error(loop).sys_errno_ == ERROR_PRIVILEGE_NOT_HELD) {
+ } else if (uv_last_error(loop).code == UV_EPERM) {
/*
* Creating a symlink is only allowed when running elevated.
- * We pass the test and bail out early if we get ERROR_PRIVILEGE_NOT_HELD.
+ * We pass the test and bail out early if we get UV_EPERM.
*/
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.