From 449b872916c29a7b9d4155b176f7aca85b8c2c84 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Tue, 15 Nov 2022 11:02:56 +0000 Subject: [PATCH] CPU: fix M2 detection --- Library/Homebrew/extend/os/mac/hardware/cpu.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index 7d08694d85..59e650c322 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -152,7 +152,11 @@ module Hardware end def sysctl_int(key) - sysctl_n(key).to_i + if (x = sysctl_n(key).to_i) >= 0 + x + else + x & 0xffffffff + end end def sysctl_n(*keys)