~/Projects/clash-pro
git clone https://code.lsong.org/clash-pro
Commit
- Commit
- c8bc11d61d578841b54e53e2a4a8731b3570cacd
- Author
- Dreamacro <8615343+[email protected]>
- Date
- 2022-10-27 15:35:53 +0800 +0800
- Diffstat
component/process/process_darwin.go | 4 ++--
Fix: amd64 macOS Ventura process name match
diff --git a/component/process/process_darwin.go b/component/process/process_darwin.go index c98453eb20ab559025c29d08fd2274b4c70554d6..814161c58b125c5cab0251ea0e9e15c98db89a40 100644 --- a/component/process/process_darwin.go +++ b/component/process/process_darwin.go @@ -18,11 +18,11 @@ proccallnumpidinfo = 0x2 ) var structSize = func() int { - value, _ := syscall.Sysctl("kern.osproductversion") + value, _ := syscall.Sysctl("kern.osrelease") major, _, _ := strings.Cut(value, ".") n, _ := strconv.ParseInt(major, 10, 64) switch true { - case n >= 13: + case n >= 22: return 408 default: // from darwin-xnu/bsd/netinet/in_pcblist.c:get_pcblist_n