tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / util / plugin.c
index a1a8aa681d0c4896a9fafcfdf9fbf12b950071af..4b922340ddf75aec8d963e2dd59866da18204fc7 100644 (file)
@@ -1,21 +1,21 @@
 /*
      This file is part of GNUnet
-     (C) 2002-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2002-2013 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     You should have received a copy of the GNU Affero General Public License
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 
 /**
@@ -28,7 +28,7 @@
 #include <ltdl.h>
 #include "gnunet_util_lib.h"
 
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-plugin", __VA_ARGS__)
 
 /**
  * Linked list of active plugins.
@@ -57,7 +57,6 @@ struct PluginList
  */
 static int initialized;
 
-
 /**
  * Libtool search path before we started.
  */
@@ -89,12 +88,12 @@ plugin_init ()
     return;
   }
   opath = lt_dlgetsearchpath ();
-  if (opath != NULL)
+  if (NULL != opath)
     old_dlsearchpath = GNUNET_strdup (opath);
   path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
-  if (path != NULL)
+  if (NULL != path)
   {
-    if (opath != NULL)
+    if (NULL != opath)
     {
       GNUNET_asprintf (&cpath, "%s:%s", opath, path);
       lt_dlsetsearchpath (cpath);
@@ -117,7 +116,7 @@ static void
 plugin_fini ()
 {
   lt_dlsetsearchpath (old_dlsearchpath);
-  if (old_dlsearchpath != NULL)
+  if (NULL != old_dlsearchpath)
   {
     GNUNET_free (old_dlsearchpath);
     old_dlsearchpath = NULL;
@@ -134,12 +133,16 @@ plugin_fini ()
  * @return NULL if the symbol was not found
  */
 static GNUNET_PLUGIN_Callback
-resolve_function (struct PluginList *plug, const char *name)
+resolve_function (struct PluginList *plug,
+                  const char *name)
 {
   char *initName;
   void *mptr;
 
-  GNUNET_asprintf (&initName, "_%s_%s", plug->name, name);
+  GNUNET_asprintf (&initName,
+                   "_%s_%s",
+                   plug->name,
+                   name);
   mptr = lt_dlsym (plug->handle, &initName[1]);
   if (NULL == mptr)
     mptr = lt_dlsym (plug->handle, initName);