summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-02-21 19:59:57 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-02-22 11:39:44 +0100
commit50b35193ec6f8f342364742a69a607e967b39b7f (patch)
tree3a87221efb9d6eec7e5d64d4dbc8aeaaa9176e53 /src/core/main.c
parent3f275dcb841bac7a29bba31c3b8b32981f6281fc (diff)
downloadsystemd-50b35193ec6f8f342364742a69a607e967b39b7f.tar.gz
meson: merge our two valgrind configuration conditions into one
Most of the support for valgrind was under HAVE_VALGRIND_VALGRIND_H, i.e. we would enable if the valgrind headers were found. The operations then we be conditionalized on RUNNING_UNDER_VALGRIND. But in a few places we had code which was conditionalized on VALGRIND, i.e. the config option. I noticed because I compiled with -Dvalgrind=true on a machine that didn't have valgrind.h, and the build failed because RUNNING_UNDER_VALGRIND was not defined. My first idea was to add a check that the header is present if the option is set, but it seems better to just remove the option. The code to support valgrind is trivial, and if we're !RUNNING_UNDER_VALGRIND, it has negligible cost. And the case of running under valgrind is always some special testing/debugging mode, so we should just do those extra steps to make valgrind output cleaner. Removing the option makes things simpler and we don't have to think if something should be covered by the one or the other configuration bit. I had a vague recollection that in some places we used -Dvalgrind=true not for valgrind support, but to enable additional cleanup under other sanitizers. But that code would fail to build without the valgrind headers anyway, so I'm not sure if that was still used. If there are uses like that, we can extend the condition for cleanup_pools().
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 1af9b8b505..c9849d05c1 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -12,7 +12,7 @@
#include <seccomp.h>
#endif
#if HAVE_VALGRIND_VALGRIND_H
-#include <valgrind/valgrind.h>
+# include <valgrind/valgrind.h>
#endif
#include "sd-bus.h"
@@ -1866,8 +1866,8 @@ static int do_reexecute(
assert(i <= args_size);
/*
- * We want valgrind to print its memory usage summary before reexecution. Valgrind won't do
- * this is on its own on exec(), but it will do it on exit(). Hence, to ensure we get a
+ * We want valgrind to print its memory usage summary before reexecution. Valgrind won't do
+ * this is on its own on exec(), but it will do it on exit(). Hence, to ensure we get a
* summary here, fork() off a child, let it exit() cleanly, so that it prints the summary,
* and wait() for it in the parent, before proceeding into the exec().
*/