aboutsummaryrefslogtreecommitdiff
path: root/src/util/plugin.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-24 09:36:10 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-24 09:36:10 +0000
commitf1ba43deea5e7a1fbc22b429196d1f9fb4e1a9f3 (patch)
tree392225e990fb9b78fd46fb488b61247846670061 /src/util/plugin.c
parent12121a352989e9e5dd890af7173045bc119db414 (diff)
downloadgnunet-f1ba43deea5e7a1fbc22b429196d1f9fb4e1a9f3.tar.gz
gnunet-f1ba43deea5e7a1fbc22b429196d1f9fb4e1a9f3.zip
-updated french translations
Diffstat (limited to 'src/util/plugin.c')
-rw-r--r--src/util/plugin.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/util/plugin.c b/src/util/plugin.c
index 18a90b6c3..c88ab8791 100644
--- a/src/util/plugin.c
+++ b/src/util/plugin.c
@@ -57,7 +57,6 @@ struct PluginList
57 */ 57 */
58static int initialized; 58static int initialized;
59 59
60
61/** 60/**
62 * Libtool search path before we started. 61 * Libtool search path before we started.
63 */ 62 */
@@ -89,12 +88,12 @@ plugin_init ()
89 return; 88 return;
90 } 89 }
91 opath = lt_dlgetsearchpath (); 90 opath = lt_dlgetsearchpath ();
92 if (opath != NULL) 91 if (NULL != opath)
93 old_dlsearchpath = GNUNET_strdup (opath); 92 old_dlsearchpath = GNUNET_strdup (opath);
94 path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR); 93 path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
95 if (path != NULL) 94 if (NULL != path)
96 { 95 {
97 if (opath != NULL) 96 if (NULL != opath)
98 { 97 {
99 GNUNET_asprintf (&cpath, "%s:%s", opath, path); 98 GNUNET_asprintf (&cpath, "%s:%s", opath, path);
100 lt_dlsetsearchpath (cpath); 99 lt_dlsetsearchpath (cpath);
@@ -117,7 +116,7 @@ static void
117plugin_fini () 116plugin_fini ()
118{ 117{
119 lt_dlsetsearchpath (old_dlsearchpath); 118 lt_dlsetsearchpath (old_dlsearchpath);
120 if (old_dlsearchpath != NULL) 119 if (NULL != old_dlsearchpath)
121 { 120 {
122 GNUNET_free (old_dlsearchpath); 121 GNUNET_free (old_dlsearchpath);
123 old_dlsearchpath = NULL; 122 old_dlsearchpath = NULL;
@@ -134,12 +133,16 @@ plugin_fini ()
134 * @return NULL if the symbol was not found 133 * @return NULL if the symbol was not found
135 */ 134 */
136static GNUNET_PLUGIN_Callback 135static GNUNET_PLUGIN_Callback
137resolve_function (struct PluginList *plug, const char *name) 136resolve_function (struct PluginList *plug,
137 const char *name)
138{ 138{
139 char *initName; 139 char *initName;
140 void *mptr; 140 void *mptr;
141 141
142 GNUNET_asprintf (&initName, "_%s_%s", plug->name, name); 142 GNUNET_asprintf (&initName,
143 "_%s_%s",
144 plug->name,
145 name);
143 mptr = lt_dlsym (plug->handle, &initName[1]); 146 mptr = lt_dlsym (plug->handle, &initName[1]);
144 if (NULL == mptr) 147 if (NULL == mptr)
145 mptr = lt_dlsym (plug->handle, initName); 148 mptr = lt_dlsym (plug->handle, initName);