summaryrefslogtreecommitdiff
path: root/src/shared/daemon-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-15 19:22:21 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-19 15:23:37 +0200
commit297fc20dc469694f054ed2be4358eb21efe89660 (patch)
tree5fad0b29fa3206c5849e01c6ba1b5e65a6da8a2b /src/shared/daemon-util.h
parente9f4a596a20a7198d7fbafeec52e95259c704d87 (diff)
downloadsystemd-297fc20dc469694f054ed2be4358eb21efe89660.tar.gz
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.
Diffstat (limited to 'src/shared/daemon-util.h')
-rw-r--r--src/shared/daemon-util.h2
1 files changed, 1 insertions, 1 deletions
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);
}