gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22999 - Extractor/src/main


From: gnunet
Subject: [GNUnet-SVN] r22999 - Extractor/src/main
Date: Tue, 31 Jul 2012 00:30:03 +0200

Author: grothoff
Date: 2012-07-31 00:30:03 +0200 (Tue, 31 Jul 2012)
New Revision: 22999

Modified:
   Extractor/src/main/Makefile.am
   Extractor/src/main/extractor_ipc.h
   Extractor/src/main/extractor_ipc_gnu.c
   Extractor/src/main/extractor_plugins.c
   Extractor/src/main/extractor_plugpath.c
Log:
-misc fixes

Modified: Extractor/src/main/Makefile.am
===================================================================
--- Extractor/src/main/Makefile.am      2012-07-30 22:08:42 UTC (rev 22998)
+++ Extractor/src/main/Makefile.am      2012-07-30 22:30:03 UTC (rev 22999)
@@ -2,8 +2,9 @@
 
 INCLUDES = -I$(top_srcdir)/src/include $(LTDLINCL)
 
-# install plugins under:
-plugindir = $(libdir)/@RPLUGINDIR@
+# install test plugins under /tmp (we must install them somewhere,
+# with 'noinst' automake insists on building a static library...)
+tmpdir = /tmp/
 
 LIBS = \
  @LE_LIBINTL@ @LE_LIB_LIBS@
@@ -34,6 +35,12 @@
 EXTRACTOR_IPC=extractor_ipc_gnu.c
 endif
 
+if HAVE_GNU_LD
+ makesymbolic=-Wl,-Bsymbolic
+endif
+
+PLUGINFLAGS = $(makesymbolic) $(LE_PLUGIN_LDFLAGS)
+
 EXTRA_DIST = \
   iconv.c fuzz_default.sh fuzz_thumbnail.sh
 
@@ -63,7 +70,7 @@
 TESTS_ENVIRONMENT = testdatadir=$(top_srcdir)/test
 TESTS_ENVIRONMENT += bindir=${bindir}
 
-noinst_LTLIBRARIES = \
+tmp_LTLIBRARIES = \
   libextractor_test.la 
 
 libextractor_test_la_SOURCES = \
@@ -77,7 +84,7 @@
  test_trivial \
  test_plugin_loading \
  test_plugin_load_multi \
- test_ipc
+ test_ipc 
 
 TESTS = $(check_PROGRAMS)
 

Modified: Extractor/src/main/extractor_ipc.h
===================================================================
--- Extractor/src/main/extractor_ipc.h  2012-07-30 22:08:42 UTC (rev 22998)
+++ Extractor/src/main/extractor_ipc.h  2012-07-30 22:30:03 UTC (rev 22999)
@@ -102,6 +102,11 @@
   unsigned char reserved;
 
   /**
+   * Always zero.
+   */
+  uint16_t reserved2;
+
+  /**
    * Name of the shared-memory name.
    */
   uint32_t shm_name_length;

Modified: Extractor/src/main/extractor_ipc_gnu.c
===================================================================
--- Extractor/src/main/extractor_ipc_gnu.c      2012-07-30 22:08:42 UTC (rev 
22998)
+++ Extractor/src/main/extractor_ipc_gnu.c      2012-07-30 22:30:03 UTC (rev 
22999)
@@ -263,6 +263,7 @@
     }
   channel->shm = shm;
   channel->plugin = plugin;
+  channel->size = 0;
   if (0 != pipe (p1))
     {
       LOG_STRERROR ("pipe");
@@ -309,13 +310,14 @@
     }  
   init->opcode = MESSAGE_INIT_STATE;
   init->reserved = 0;
+  init->reserved2 = 0;
   init->shm_name_length = slen;
   init->shm_map_size = shm->shm_size;
   memcpy (&init[1], shm->shm_name, slen);
-  if (sizeof (init) !=
+  if (sizeof (struct InitMessage) + slen !=
       EXTRACTOR_IPC_channel_send_ (channel,
                                   init,
-                                  sizeof (init) + slen) )
+                                  sizeof (struct InitMessage) + slen) )
     {
       LOG ("Failed to send INIT_STATE message to plugin\n");
       EXTRACTOR_IPC_channel_destroy_ (channel);

Modified: Extractor/src/main/extractor_plugins.c
===================================================================
--- Extractor/src/main/extractor_plugins.c      2012-07-30 22:08:42 UTC (rev 
22998)
+++ Extractor/src/main/extractor_plugins.c      2012-07-30 22:30:03 UTC (rev 
22999)
@@ -165,8 +165,9 @@
   lt_dladvise_destroy (&advise);
   if (NULL == plugin->libraryHandle)
     {
-      LOG ("Loading `%s' plugin failed: %s\n",
+      LOG ("Loading `%s' plugin failed (using name `%s'): %s\n",
           plugin->short_libname,
+          plugin->libname,
           lt_dlerror ());
       free (plugin->libname);
       plugin->libname = NULL;

Modified: Extractor/src/main/extractor_plugpath.c
===================================================================
--- Extractor/src/main/extractor_plugpath.c     2012-07-30 22:08:42 UTC (rev 
22998)
+++ Extractor/src/main/extractor_plugpath.c     2012-07-30 22:30:03 UTC (rev 
22999)
@@ -514,8 +514,12 @@
     {
       if ('.' == ent->d_name[0])
        continue;
-      if ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
-          ('\0' == la[3]) )
+      if ( ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
+            ('\0' == la[3]) ) ||
+          ( (NULL != (la = strstr (ent->d_name, ".ver"))) &&
+            (la[4] == '\0') ) ||
+          ( (NULL != (la = strstr (ent->d_name, ".a"))) &&
+            (la[2] == '\0') ) )
        continue; /* only load '.so' and '.dll' */
       if (NULL == (sym_name = strrchr (ent->d_name, '_')))
        continue;       
@@ -601,6 +605,8 @@
        continue;
       if ( ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
             (la[3] == '\0') ) ||
+          ( (NULL != (la = strstr (ent->d_name, ".ver"))) &&
+            (la[4] == '\0') ) ||
           ( (NULL != (la = strstr (ent->d_name, ".a"))) &&
             (la[2] == '\0')) )
        continue; /* only load '.so' and '.dll' */
@@ -616,11 +622,8 @@
        }
       if (NULL != (dot = strchr (sym, '.')))
        *dot = '\0';
-#if DEBUG > 1
-      fprintf (stderr,
-              "Adding default plugin `%s'\n",
-              sym);
-#endif
+      LOG ("Adding default plugin `%s'\n",
+          sym);
       dlc->res = EXTRACTOR_plugin_add (dlc->res,
                                       sym,
                                       NULL,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]