From 95d45be7eace49f7ea57ad89ed084ce7f3c84741 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Oct 2014 07:41:41 +0200 Subject: RTLD_NOW for easier debug on Unix; bail on empty dlopen(3) filenames --- opentrack/plugin-support.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'opentrack') diff --git a/opentrack/plugin-support.cpp b/opentrack/plugin-support.cpp index fe593bc4..1c95f808 100644 --- a/opentrack/plugin-support.cpp +++ b/opentrack/plugin-support.cpp @@ -120,6 +120,10 @@ dylib::dylib(const QString& filename, Type t) : Constructor(nullptr), Meta(nullptr) { + // otherwise dlopen opens the calling executable + if (filename.size() == 0) + return; + this->filename = filename; #if defined(_WIN32) QString fullPath = QCoreApplication::applicationDirPath() + "/" + this->filename; @@ -156,7 +160,7 @@ dylib::dylib(const QString& filename, Type t) : QByteArray latin1 = QFile::encodeName(filename); handle = dlopen(latin1.constData(), RTLD_NOW | # ifdef __linux - RTLD_DEEPBIND + RTLD_DEEPBIND|RTLD_LOCAL|RTLD_NOW # elif defined(__APPLE__) RTLD_LOCAL|RTLD_FIRST|RTLD_NOW # else -- cgit v1.2.3