Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
default numcores to 1 if we can't figure it out
Browse files Browse the repository at this point in the history
Change-Id: I56fde65a413db7f63fa2a9c4e93fe371b833568d
  • Loading branch information
Patrick Bozeman committed Nov 1, 2011
1 parent b79753b commit 4bfe9c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/lib/vcap/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ def self.num_cores
elsif RUBY_PLATFORM =~ /freebsd|netbsd/
`sysctl hw.ncpu`.strip.to_i
else
# FIXME: wouldn't it be logical to assume there is at least 1 core!?
return -1 # unknown..
return 1 # unknown..
end
rescue
# hwprefs doesn't always exist, and so the block above can fail.
# In any case, let's always assume that there is 1 core
1
end

def self.defer(*args, &blk)
Expand Down

0 comments on commit 4bfe9c1

Please sign in to comment.