[PATCH] Fix the detection of the number of CPUs for OpenBSD.

Brad Smith brad at comstyle.com
Fri Sep 17 19:38:51 CDT 2010


---
 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 ee50921..0f37def 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1191,15 +1191,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__)
     {
-- 
1.7.1


--LZvS9be/3tNcYl/X--



More information about the wine-patches mailing list