lib/celluloid/cpu_counter.rb in celluloid-0.14.1 vs lib/celluloid/cpu_counter.rb in celluloid-0.15.0.pre
- old
+ new
@@ -2,10 +2,10 @@
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
- @cores = Integer(`sysctl hw.ncpu`[/\d+/])
+ @cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count