diff options
| author | Jack Nagel | 2014-07-05 13:50:54 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-05 15:41:22 -0500 |
| commit | 3e2f255b2ba9489e3370cdbd9f518db9b7413fed (patch) | |
| tree | 5db4776f60f500b3a291578dc5fee21babc9a707 /Library/Homebrew/os | |
| parent | 6833266bb0bfbc7628026176bd54ebd998e663d4 (diff) | |
| download | homebrew-3e2f255b2ba9489e3370cdbd9f518db9b7413fed.tar.bz2 | |
Use popen wrapper
Closes #30678.
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac/hardware.rb | 5 |
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 |
