diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-06-16 21:45:03 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-06-16 21:45:03 +0900 |
commit | af8244e3e02690e251d24f38abbb1e7742250758 (patch) | |
tree | 732b9f2b56fbd801919d8f28933441d6ca48463d /tqt/kqt3.cpp | |
parent | 7080e95da6d4c653cb208c55cac2d3a31ff6d652 (diff) | |
download | kgtk-qt3-af8244e3e02690e251d24f38abbb1e7742250758.tar.gz kgtk-qt3-af8244e3e02690e251d24f38abbb1e7742250758.zip |
Fixed problem with dlsym lookup. This resolve bug 2477.
Partially inspired by posts at
https://stackoverflow.com/questions/15599026/how-can-i-intercept-dlsym-calls-using-ld-preload
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tqt/kqt3.cpp')
-rw-r--r-- | tqt/kqt3.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/tqt/kqt3.cpp b/tqt/kqt3.cpp index 8ceb265..97b3584 100644 --- a/tqt/kqt3.cpp +++ b/tqt/kqt3.cpp @@ -120,19 +120,25 @@ static const char * getAppName(bool useTQt=true) int TQApplication::exec() { - static bool init=false; - - if(!init) - { - connectToKDialogD(getAppName(false)); - init=true; - } - - static int (*realFunction)(void *); - - if(!realFunction) - realFunction = (int (*)(void *)) dlsym(RTLD_NEXT, KQT_QAPPLICATION_EXEC); - return (int)realFunction(this); + static bool init=false; + + if(!init) + { + connectToKDialogD(getAppName(false)); + init=true; + } + + static int (*realFunction)(void *); + + if(!realFunction) + realFunction = (int (*)(void *)) dlsym(RTLD_NEXT, KQT_QAPPLICATION_EXEC); + if (realFunction) + return (int)realFunction(this); + else + { + tqWarning("kgtk-qt3 tqt TQApplication::exec() realFunction not found!!"); + return 255; + } }; static TQString qt2KdeFilter(const TQString &f) |