Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdjournal: don't close libsystemd on Close()
There is a symbol cache (map from function names to their addresses) so we don't need to call dlsym everytime we call a function from libsystemd if it was already called before. Every time we open a new Journal, we call dlopen(), and every time we close it, we call dlclose(). Since the map was global and we weren't clearing it up after closing Journal, we were reusing the addresses from the previous invocation. This is wrong because libsystemd can end up in a different address the second time we dlopen() it. Instead, just don't call dlclose() when we close the Journal so libsystemd remains in the process address space for the whole life of it. This means the symbol cache will be shared between different Journal instances.
- Loading branch information