aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/mac
diff options
context:
space:
mode:
authorJack Nagel2014-07-05 13:50:54 -0500
committerJack Nagel2014-07-05 15:41:22 -0500
commit2d8a3ac35a71641c786de9f41389a3e5003b7141 (patch)
tree0ec4efd788bd3a10c14e48d354659c28763658eb /Library/Homebrew/os/mac
parentad27b21cd11a4e28f4174ebb54df357d6b6221a0 (diff)
downloadbrew-2d8a3ac35a71641c786de9f41389a3e5003b7141.tar.bz2
Use popen wrapper
Closes Homebrew/homebrew#30678.
Diffstat (limited to 'Library/Homebrew/os/mac')
-rw-r--r--Library/Homebrew/os/mac/hardware.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb
index a6b5ccf2c..158e928cd 100644
--- a/Library/Homebrew/os/mac/hardware.rb
+++ b/Library/Homebrew/os/mac/hardware.rb
@@ -140,10 +140,7 @@ module MacCPUs
def sysctl_bool(property)
(@properties ||= {}).fetch(property) do
- result = nil
- IO.popen("/usr/sbin/sysctl -n '#{property}' 2>/dev/null") do |f|
- result = f.gets.to_i # should be 0 or 1
- end
+ result = Utils.popen_read("/usr/sbin/sysctl", "-n", property, &:gets).to_i
# sysctl call succeded and printed 1
@properties[property] = $?.success? && result == 1
end