diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-07-30 22:08:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-07-30 22:08:42 +0000 |
commit | 3020be29f9e38e84054b7199bcd59632785a5d25 (patch) | |
tree | f3be76b439728b441498712f9982123ad34d1728 | |
parent | 6141cdf88e129ae0b1ba0fe0c96644cacc54e41c (diff) | |
download | libextractor-3020be29f9e38e84054b7199bcd59632785a5d25.tar.gz libextractor-3020be29f9e38e84054b7199bcd59632785a5d25.zip |
-fixes
-rw-r--r-- | src/main/extractor.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/main/extractor.c b/src/main/extractor.c index c91e8ab..7b6d911 100644 --- a/src/main/extractor.c +++ b/src/main/extractor.c | |||
@@ -373,6 +373,7 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, | |||
373 | struct EXTRACTOR_Datasource *datasource; | 373 | struct EXTRACTOR_Datasource *datasource; |
374 | struct EXTRACTOR_SharedMemory *shm; | 374 | struct EXTRACTOR_SharedMemory *shm; |
375 | struct EXTRACTOR_PluginList *pos; | 375 | struct EXTRACTOR_PluginList *pos; |
376 | int have_oop; | ||
376 | 377 | ||
377 | if (NULL == plugins) | 378 | if (NULL == plugins) |
378 | return; | 379 | return; |
@@ -385,20 +386,29 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, | |||
385 | if (NULL == datasource) | 386 | if (NULL == datasource) |
386 | return; | 387 | return; |
387 | shm = NULL; | 388 | shm = NULL; |
389 | have_oop = 0; | ||
388 | for (pos = plugins; NULL != pos; pos = pos->next) | 390 | for (pos = plugins; NULL != pos; pos = pos->next) |
389 | if (NULL != (shm = pos->shm)) | 391 | { |
390 | break; | 392 | if (NULL != (shm = pos->shm)) |
391 | if (NULL == shm) | 393 | break; |
392 | shm = EXTRACTOR_IPC_shared_memory_create_ (DEFAULT_SHM_SIZE); | 394 | if (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) |
393 | for (pos = plugins; NULL != pos; pos = pos->next) | 395 | have_oop = 1; |
394 | if ( (NULL == pos->shm) && | 396 | } |
395 | (EXTRACTOR_OPTION_IN_PROCESS == pos->flags) ) | 397 | if ( (NULL == shm) && |
396 | { | 398 | (1 == have_oop) ) |
397 | pos->shm = shm; | 399 | { |
398 | (void) EXTRACTOR_IPC_shared_memory_change_rc_ (shm, 1); | 400 | /* need to create shared memory segment */ |
399 | pos->channel = EXTRACTOR_IPC_channel_create_ (pos, | 401 | shm = EXTRACTOR_IPC_shared_memory_create_ (DEFAULT_SHM_SIZE); |
400 | shm); | 402 | for (pos = plugins; NULL != pos; pos = pos->next) |
401 | } | 403 | if ( (NULL == pos->shm) && |
404 | (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) ) | ||
405 | { | ||
406 | pos->shm = shm; | ||
407 | (void) EXTRACTOR_IPC_shared_memory_change_rc_ (shm, 1); | ||
408 | pos->channel = EXTRACTOR_IPC_channel_create_ (pos, | ||
409 | shm); | ||
410 | } | ||
411 | } | ||
402 | do_extract (plugins, shm, datasource, proc, proc_cls); | 412 | do_extract (plugins, shm, datasource, proc, proc_cls); |
403 | EXTRACTOR_datasource_destroy_ (datasource); | 413 | EXTRACTOR_datasource_destroy_ (datasource); |
404 | } | 414 | } |