# HG changeset patch # User Chris Cannam # Date 1541424945 0 # Node ID 17fb9ff8e07240cb2b59f672f43ca48ac5041666 # Parent dd193244d97d9588cfb5de56117200026ed321f0 Carry out EPERM test only if Apple diff -r dd193244d97d -r 17fb9ff8e072 src/helper.cpp --- a/src/helper.cpp Fri Nov 02 14:39:51 2018 +0000 +++ b/src/helper.cpp Mon Nov 05 13:35:45 2018 +0000 @@ -250,17 +250,24 @@ code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; } } -#else - if (!libraryExists(soname)) { - code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; - } else if (errno == EPERM) { +#else // !_WIN32 +#ifdef __APPLE__ + if (errno == EPERM) { // This may be unreliable, but it seems to be set by // something dlopen() calls in the case where a library // can't be loaded for code-signing-related reasons on // macOS code = PluginCheckCode::FAIL_FORBIDDEN; + } else if (!libraryExists(soname)) { + code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; } -#endif +#else // !__APPLE__ + if (!libraryExists(soname)) { + code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; + } +#endif // !__APPLE__ +#endif // !_WIN32 + return { code, message }; }