Don't stop writer thread before all data is processed
This commit is contained in:
parent
972da5776a
commit
5dfb70a328
@ -937,19 +937,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<auparse_state_t, void(*)(auparse_state_t*)> au(auparse_init(AUSOURCE_FEED, 0), [](auparse_state_t *obj){
|
||||
if (obj)
|
||||
{
|
||||
auparse_flush_feed(obj);
|
||||
auparse_destroy(obj);
|
||||
}
|
||||
});
|
||||
|
||||
if (!au)
|
||||
{
|
||||
throw std::runtime_error("Failed to initialize audit");
|
||||
}
|
||||
|
||||
std::unique_ptr<std::thread, void(*)(std::thread*)> writer_thread(
|
||||
use_writer_thread ? new std::thread(
|
||||
writer_thread_function,
|
||||
@ -976,6 +963,19 @@ int main(int argc, char **argv)
|
||||
}
|
||||
});
|
||||
|
||||
std::unique_ptr<auparse_state_t, void(*)(auparse_state_t*)> au(auparse_init(AUSOURCE_FEED, 0), [](auparse_state_t *obj){
|
||||
if (obj)
|
||||
{
|
||||
auparse_flush_feed(obj);
|
||||
auparse_destroy(obj);
|
||||
}
|
||||
});
|
||||
|
||||
if (!au)
|
||||
{
|
||||
throw std::runtime_error("Failed to initialize audit");
|
||||
}
|
||||
|
||||
auparse_add_callback(au.get(), auparse_callback, &callback_data, NULL);
|
||||
|
||||
std::vector<char> data;
|
||||
|
Loading…
Reference in New Issue
Block a user