mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/dtrace/helper.rb: Etc.getgrnam may return nil on some platforms
This commit is contained in:
parent
2ca353c2e0
commit
6525d3bcc7
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ if RUBY_PLATFORM =~ /linux/
|
||||||
impl = :stap
|
impl = :stap
|
||||||
begin
|
begin
|
||||||
require 'etc'
|
require 'etc'
|
||||||
ok = (%w[stapusr stapdev].map {|g|Etc.getgrnam(g).gid} & Process.groups).size == 2
|
ok = (%w[stapusr stapdev].map {|g|(Etc.getgrnam(g) || raise(ArgumentError)).gid} & Process.groups).size == 2
|
||||||
rescue LoadError, ArgumentError
|
rescue LoadError, ArgumentError
|
||||||
end unless ok
|
end unless ok
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue