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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-10-15 19:22:21 +02:00
parent e9f4a596a2
commit 297fc20dc4
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}