diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-09 16:02:55 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-11 11:10:37 +0200 |
commit | a5d8835c78112206bbf0812dd4cb471f803bfe88 (patch) | |
tree | f42a5d79e0d5b0357def1891b3b8dc8aa43feb0d /src/basic/mempool.c | |
parent | 7c48ea02800782651b7da373c6165abb052f1382 (diff) | |
download | systemd-a5d8835c78112206bbf0812dd4cb471f803bfe88.tar.gz |
mempool: only enable mempool use when linked to libsystemd-shared.so
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.
Should fix assert crashes in external programs caused by #9792.
Replaces #10286.
v2:
- use two different source files instead of a gcc constructor
Diffstat (limited to 'src/basic/mempool.c')
-rw-r--r-- | src/basic/mempool.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/mempool.c b/src/basic/mempool.c index 9f17b77e47..159c963377 100644 --- a/src/basic/mempool.c +++ b/src/basic/mempool.c @@ -78,6 +78,8 @@ bool mempool_enabled(void) { if (!is_main_thread()) return false; + if (!mempool_use_allowed) + b = false; if (b < 0) b = getenv_bool("SYSTEMD_MEMPOOL") != 0; |