From: Zbigniew Jędrzejewski-Szmek Date: Thu, 15 Oct 2020 17:22:21 +0000 (+0200) Subject: shared/daemon-util: fix notify_on_cleanup() X-Git-Tag: v247-rc1~47^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=297fc20dc469694f054ed2be4358eb21efe89660;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/daemon-util.h b/src/shared/daemon-util.h index 5e9eca1d9e7..04b82453100 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); }