sd-notify: fix unsetting of environment variable on error
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Apr 2024 11:40:11 +0000 (13:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Apr 2024 11:56:17 +0000 (13:56 +0200)
commit362dcfc5db0271cd6b3a564c528cabf0ac0e7993
treef5fef0448085ee7ed0a18463bca28240e606be5a
parent19e980eb92d923a25f0cbc38b945c282bc5f5b1b
sd-notify: fix unsetting of environment variable on error

The man page says that the variable will be unset even if the call fails.
But we weren't consistent: for some errors we would return early. This
is not good, because based on the man page, the caller may use just print
a warning, or even use '(void) sd_notify(…)' for the call.
src/libsystemd/sd-daemon/sd-daemon.c