diff options
author | leper <none@none> | 2013-08-08 00:10:52 +0400 |
---|---|---|
committer | leper <none@none> | 2013-08-08 00:10:52 +0400 |
commit | da779befdfd069c33946d8a037e25774ea67df14 (patch) | |
tree | 0a5a5b298b4750aa36a7cd7fd919060418b0c362 | |
parent | fc3d38a1670e9f549a1b60d8290a906b2b2b388e (diff) |
Handle missing ld.so.conf gracefully instead of crashing.
-rw-r--r-- | src/base/os.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/base/os.lua b/src/base/os.lua index 87255da..ac71334 100644 --- a/src/base/os.lua +++ b/src/base/os.lua @@ -23,7 +23,12 @@ -- Linux ldconfig file parser to find system library locations
local first, last
local dirs = { }
- for line in io.lines(conf_file) do
+ local fiel = io.open(conf_file)
+ -- Handle missing ld.so.conf (BSDs) gracefully
+ if file == nil then
+ return dirs
+ end
+ for line in file:lines() do
-- ignore comments
first = line:find("#", 1, true)
if first ~= nil then
|