Submitted By: Jonathan Norman Date: 2009-09-20 Initial Package Version: 4.999.9beta Upstream Status: Unknown Origin: NetBSD Description: Corrects the way results from systcl() were being tested. http://www.nabble.com/pkg-41963:-archivers-xz-compilation-errors-%28NetBSD-4.0---i386%29-td25233287.html diff -Naur xz-4.999.9beta.orig/src/common/cpucores.h xz-4.999.9beta/src/common/cpucores.h --- xz-4.999.9beta.orig/src/common/cpucores.h 2009-09-20 21:57:33.000000000 +0000 +++ xz-4.999.9beta/src/common/cpucores.h 2009-09-20 22:00:21.000000000 +0000 @@ -40,7 +40,7 @@ int name[2] = { CTL_HW, HW_NCPU }; int cpus; size_t cpus_size = sizeof(cpus); - if (!sysctl(name, &cpus, &cpus_size, NULL, NULL) + if (sysctl(name, 2, &cpus, &cpus_size, NULL, 0) > 0 && cpus_size == sizeof(cpus) && cpus > 0) ret = (uint32_t)(cpus); #endif diff -Naur xz-4.999.9beta.orig/src/common/physmem.h xz-4.999.9beta/src/common/physmem.h --- xz-4.999.9beta.orig/src/common/physmem.h 2009-09-20 21:57:33.000000000 +0000 +++ xz-4.999.9beta/src/common/physmem.h 2009-09-20 22:02:10.000000000 +0000 @@ -104,7 +104,7 @@ uint64_t u64; } mem; size_t mem_ptr_size = sizeof(mem.u64); - if (!sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, NULL)) { + if (sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, 0) > 0) { // IIRC, 64-bit "return value" is possible on some 64-bit // BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64), // so support both.