Brad Smith : ntll: Fix the detection of the number of CPUs for OpenBSD.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 14:41:48 CDT 2010


Module: wine
Branch: stable
Commit: 6267e97429eb4e14c0257220f3042135365bb861
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6267e97429eb4e14c0257220f3042135365bb861

Author: Brad Smith <brad at comstyle.com>
Date:   Fri Sep 17 20:38:51 2010 -0400

ntll: Fix the detection of the number of CPUs for OpenBSD.
(cherry picked from commit 466b64032f733777b517828f3fc141a77feb3cdc)

---

 dlls/ntdll/nt.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index a2b1023..99fe77b 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1164,15 +1164,16 @@ void fill_cpu_info(void)
     }
 #elif defined (__OpenBSD__)
     {
-        int mib[2], num;
+        int mib[2], num, ret;
         size_t len;
 
         mib[0] = CTL_HW;
         mib[1] = HW_NCPU;
         len = sizeof(num);
 
-        num = sysctl(mib, 2, &num, &len, NULL, 0);
-        NtCurrentTeb()->Peb->NumberOfProcessors = num;
+        ret = sysctl(mib, 2, &num, &len, NULL, 0);
+        if (!ret)
+            NtCurrentTeb()->Peb->NumberOfProcessors = num;
     }
 #elif defined (__APPLE__)
     {




More information about the wine-cvs mailing list