os/linux/ld: do not crash the program if the ld.so.conf
entry is not readable
This commit is contained in:
parent
2992b7f519
commit
b2d621ce6f
@ -49,6 +49,8 @@ module OS
|
|||||||
def self.library_paths(conf_path = Pathname(sysconfdir)/"ld.so.conf")
|
def self.library_paths(conf_path = Pathname(sysconfdir)/"ld.so.conf")
|
||||||
conf_file = Pathname(conf_path)
|
conf_file = Pathname(conf_path)
|
||||||
return [] unless conf_file.exist?
|
return [] unless conf_file.exist?
|
||||||
|
return [] unless conf_file.file?
|
||||||
|
return [] unless conf_file.readable?
|
||||||
|
|
||||||
@library_paths_cache ||= T.let({}, T.nilable(T::Hash[String, T::Array[String]]))
|
@library_paths_cache ||= T.let({}, T.nilable(T::Hash[String, T::Array[String]]))
|
||||||
cache_key = conf_file.to_s
|
cache_key = conf_file.to_s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user