From 297fc20dc469694f054ed2be4358eb21efe89660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 15 Oct 2020 19:22:21 +0200 Subject: [PATCH] shared/daemon-util: fix notify_on_cleanup() p itself is never null. Because of this, we would always call sd_notify() in cleanup, even though the intention was to only call it if notify_start() was executed. --- src/shared/daemon-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/daemon-util.h b/src/shared/daemon-util.h index 5e9eca1d9e..04b8245310 100644 --- a/src/shared/daemon-util.h +++ b/src/shared/daemon-util.h @@ -17,6 +17,6 @@ static inline const char *notify_start(const char *start, const char *stop) { /* This is intended to be used with _cleanup_ attribute. */ static inline void notify_on_cleanup(const char **p) { - if (p) + if (*p) (void) sd_notify(false, *p); }