gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r22998 - Extractor/src/main
Date: Tue, 31 Jul 2012 00:08:42 +0200

Author: grothoff
Date: 2012-07-31 00:08:42 +0200 (Tue, 31 Jul 2012)
New Revision: 22998

Modified:
   Extractor/src/main/extractor.c
Log:
-fixes

Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c      2012-07-30 22:05:58 UTC (rev 22997)
+++ Extractor/src/main/extractor.c      2012-07-30 22:08:42 UTC (rev 22998)
@@ -373,6 +373,7 @@
   struct EXTRACTOR_Datasource *datasource;
   struct EXTRACTOR_SharedMemory *shm;
   struct EXTRACTOR_PluginList *pos;
+  int have_oop;
 
   if (NULL == plugins)
     return;
@@ -385,20 +386,29 @@
   if (NULL == datasource)
     return;  
   shm = NULL;
+  have_oop = 0;
   for (pos = plugins; NULL != pos; pos = pos->next)
-    if (NULL != (shm = pos->shm))
-      break;
-  if (NULL == shm)
-    shm = EXTRACTOR_IPC_shared_memory_create_ (DEFAULT_SHM_SIZE);
-  for (pos = plugins; NULL != pos; pos = pos->next)
-    if ( (NULL == pos->shm) &&
-        (EXTRACTOR_OPTION_IN_PROCESS == pos->flags) )
-      {
-       pos->shm = shm;
-       (void) EXTRACTOR_IPC_shared_memory_change_rc_ (shm, 1);
-       pos->channel = EXTRACTOR_IPC_channel_create_ (pos,
-                                                     shm);
-      }
+    {
+      if (NULL != (shm = pos->shm))
+       break;
+      if (EXTRACTOR_OPTION_IN_PROCESS != pos->flags)
+       have_oop = 1;
+    }
+  if ( (NULL == shm) &&
+       (1 == have_oop) )
+    {
+      /* need to create shared memory segment */
+      shm = EXTRACTOR_IPC_shared_memory_create_ (DEFAULT_SHM_SIZE);
+      for (pos = plugins; NULL != pos; pos = pos->next)
+       if ( (NULL == pos->shm) &&
+            (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) )
+         {
+           pos->shm = shm;
+           (void) EXTRACTOR_IPC_shared_memory_change_rc_ (shm, 1);
+           pos->channel = EXTRACTOR_IPC_channel_create_ (pos,
+                                                         shm);
+         }
+    }
   do_extract (plugins, shm, datasource, proc, proc_cls);
   EXTRACTOR_datasource_destroy_ (datasource);
 }




reply via email to

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