[Pkg-voip-commits] r9122 - in /ptlib/trunk/debian: changelog patches/ patches/dlclose_fix.patch patches/series
kilian at alioth.debian.org
kilian at alioth.debian.org
Mon Jul 11 12:12:56 UTC 2011
Author: kilian
Date: Mon Jul 11 12:12:56 2011
New Revision: 9122
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=9122
Log:
Add dlclose fix from upstream to unloading plugins without ld.so issuing
an error
Added:
ptlib/trunk/debian/patches/
ptlib/trunk/debian/patches/dlclose_fix.patch
ptlib/trunk/debian/patches/series
Modified:
ptlib/trunk/debian/changelog
Modified: ptlib/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/ptlib/trunk/debian/changelog?rev=9122&op=diff
==============================================================================
--- ptlib/trunk/debian/changelog (original)
+++ ptlib/trunk/debian/changelog Mon Jul 11 12:12:56 2011
@@ -21,8 +21,10 @@
(this makes c++ symbol files somewhat less painful. But still different
g++ versions emit a bit different symbol sets so ftbfs'es happen)
* Register API documentation with doc-base
-
- -- Kilian Krause <kilian at debian.org> Fri, 01 Jul 2011 20:28:55 +0200
+ * Add dlclose fix from upstream to unloading plugins without ld.so issuing
+ an error
+
+ -- Kilian Krause <kilian at debian.org> Mon, 11 Jul 2011 14:12:02 +0200
ptlib (2.8.4-1) experimental; urgency=low
Added: ptlib/trunk/debian/patches/dlclose_fix.patch
URL: http://svn.debian.org/wsvn/pkg-voip/ptlib/trunk/debian/patches/dlclose_fix.patch?rev=9122&op=file
==============================================================================
--- ptlib/trunk/debian/patches/dlclose_fix.patch (added)
+++ ptlib/trunk/debian/patches/dlclose_fix.patch Mon Jul 11 12:12:56 2011
@@ -1,0 +1,142 @@
+Origin: upstream
+Description: Fix dlclose problem with newer glibc's
+
+Taken from upstream's SVN r26169
+Index: src/ptlib/unix/udll.cxx
+===================================================================
+--- src/ptlib/unix/udll.cxx (revision 26168)
++++ src/ptlib/unix/udll.cxx (revision 26169)
+@@ -295,14 +295,13 @@
+ #else
+
+ PDynaLink::PDynaLink()
++ : dllHandle(NULL)
+ {
+- dllHandle = NULL;
+ }
+
+ PDynaLink::PDynaLink(const PString & _name)
+- : name(_name)
++ : dllHandle(NULL)
+ {
+- dllHandle = NULL;
+ Open(_name);
+ }
+
+@@ -322,15 +321,20 @@
+
+ PBoolean PDynaLink::Open(const PString & _name)
+ {
++ PWaitAndSignal m(GetDLLMutex());
++
+ m_lastError.MakeEmpty();
+
+ Close();
+
++ if (_name.IsEmpty())
++ return false;
++
++ PTRACE(4, "UDLL\topening " << _name);
++
+ name = _name;
+
+ {
+- PWaitAndSignal m(GetDLLMutex());
+-
+ #if defined(P_OPENBSD)
+ dllHandle = dlopen((char *)(const char *)name, RTLD_NOW);
+ #else
+@@ -349,10 +353,16 @@
+
+ void PDynaLink::Close()
+ {
+- if (dllHandle != NULL) {
+- dlclose(dllHandle);
+- dllHandle = NULL;
+- }
++ PWaitAndSignal m(GetDLLMutex());
++
++ if (dllHandle == NULL)
++ return;
++
++ PTRACE(4, "UDLL\tClosing " << name);
++
++
++ dlclose(dllHandle);
++ dllHandle = NULL;
+ name.MakeEmpty();
+ }
+
+@@ -363,6 +373,8 @@
+
+ PString PDynaLink::GetName(PBoolean full) const
+ {
++ PWaitAndSignal m(GetDLLMutex());
++
+ if (!IsLoaded())
+ return "";
+
+@@ -390,6 +402,8 @@
+
+ PBoolean PDynaLink::GetFunction(const PString & fn, Function & func)
+ {
++ PWaitAndSignal m(GetDLLMutex());
++
+ m_lastError.MakeEmpty();
+
+ if (dllHandle == NULL)
+Index: src/ptlib/common/pluginmgr.cxx
+===================================================================
+--- src/ptlib/common/pluginmgr.cxx (revision 26168)
++++ src/ptlib/common/pluginmgr.cxx (revision 26169)
+@@ -410,7 +410,22 @@
+ return PTrue;
+ }
+
++void PPluginManager::OnShutdown()
++{
++ for (PINDEX i = 0; i < plugins.GetSize(); i++)
++ CallNotifier(plugins[i], 0);
+
++ PWaitAndSignal m(notifiersMutex);
++ for (PList<PNotifier>::iterator i = notifiers.begin(); i != notifiers.end(); i++) {
++ notifiers.Remove(&*i);
++ i = notifiers.begin();
++ }
++
++ while (plugins.GetSize() > 0)
++ plugins.RemoveAt(0);
++}
++
++
+ void PPluginManager::AddNotifier(const PNotifier & notifyFunction, PBoolean existing)
+ {
+ PWaitAndSignal m(notifiersMutex);
+@@ -507,6 +522,8 @@
+ mgr->OnShutdown();
+ delete mgr;
+ }
++
++ PPluginManager::GetPluginManager().OnShutdown();
+ }
+
+ PFACTORY_CREATE(PFactory<PProcessStartup>, PluginLoaderStartup, "PluginLoader", true);
+Index: include/ptlib/pluginmgr.h
+===================================================================
+--- include/ptlib/pluginmgr.h (revision 26168)
++++ include/ptlib/pluginmgr.h (revision 26169)
+@@ -62,6 +62,8 @@
+ // functions to load/unload a dynamic plugin
+ PBoolean LoadPlugin (const PString & fileName);
+ void LoadPluginDirectory (const PDirectory & dir);
++
++ void OnShutdown();
+
+ // functions to access the plugins' services
+ PStringArray GetPluginTypes() const;
+
+Property changes on: .
+___________________________________________________________________
+Modified: svn:mergeinfo
+ Merged /ptlib/trunk:r26166
+
Added: ptlib/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/ptlib/trunk/debian/patches/series?rev=9122&op=file
==============================================================================
--- ptlib/trunk/debian/patches/series (added)
+++ ptlib/trunk/debian/patches/series Mon Jul 11 12:12:56 2011
@@ -1,0 +1,1 @@
+dlclose_fix.patch
More information about the Pkg-voip-commits
mailing list