Skip to content

Commit

Permalink
test/dtrace/helper.rb: Etc.getgrnam may return nil on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Oct 6, 2019
1 parent 2ca353c commit 6525d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/dtrace/helper.rb
Expand Up @@ -19,7 +19,7 @@
impl = :stap
begin
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
end unless ok
end
Expand Down

0 comments on commit 6525d3b

Please sign in to comment.