Skip to content

Commit

Permalink
Fix Linux OS name detection
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Dec 5, 2014
1 parent 45ba462 commit 89357d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/phusion_passenger/platform_info/operating_system.rb
Expand Up @@ -34,14 +34,14 @@ module PlatformInfo
def self.os_name
if rb_config['target_os'] =~ /darwin/ && (sw_vers = find_command('sw_vers'))
return "macosx"
elsif rb_config['target_os'] == "linux-"
elsif rb_config['target_os'] =~ /^linux-/
return "linux"
else
return rb_config['target_os']
end
end
memoize :os_name

# The current platform's shared library extension ('so' on most Unices).
def self.library_extension
if os_name == "macosx"
Expand All @@ -50,7 +50,7 @@ def self.library_extension
return "so"
end
end

# Returns the `uname` command, or nil if `uname` cannot be found.
# In addition to looking for `uname` in `PATH`, this method also looks
# for `uname` in /bin and /usr/bin, just in case the user didn't
Expand Down Expand Up @@ -129,7 +129,7 @@ def self.cpu_architectures
elsif arch == "amd64"
arch = "x86_64"
end

if arch == "x86"
# Most x86 operating systems nowadays are probably running on
# a CPU that supports both x86 and x86_64, but we're not gonna
Expand All @@ -146,7 +146,7 @@ def self.cpu_architectures
end
end
memoize :cpu_architectures, true

# Returns whether the OS's main CPU architecture supports the
# x86/x86_64 sfence instruction.
def self.supports_sfence_instruction?
Expand All @@ -161,7 +161,7 @@ def self.supports_sfence_instruction?
}))
end
memoize :supports_sfence_instruction?, true

# Returns whether the OS's main CPU architecture supports the
# x86/x86_64 lfence instruction.
def self.supports_lfence_instruction?
Expand Down

0 comments on commit 89357d0

Please sign in to comment.