0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::mods: Perform checks before entering boost::dll to avoid obscure error messages.

fixes #80
This commit is contained in:
Jason Volk 2019-06-13 16:07:34 -06:00
parent 74d53675f8
commit f2ae3d6368

View file

@ -1048,13 +1048,25 @@ ircd::mods::info(const string_view &p,
F&& closure)
try
{
const bool relative
{
fs::is_relative(p)
};
const auto path
{
fs::is_relative(p)?
relative?
fs::_path(fullpath(p)):
fs::_path(p)
};
// Check stuff first to avoid obscure errors generated by boost::dll
if(!relative && !fs::exists(p))
throw fs::error
{
make_error_code(std::errc::no_such_file_or_directory), "`%s'", p
};
boost::dll::library_info info
{
path