summaryrefslogtreecommitdiff
path: root/src/sd-daemon.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-17 22:53:55 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-17 22:53:55 +0200
commit08bfb8106b3a337ebf9a4bf3a8ddd2e494d18b48 (patch)
tree3de39d54005094d3380b4e98c6b9f8c66ee2cfc4 /src/sd-daemon.c
parentbbe63281ea16ed9899dd4818874098c05e36b154 (diff)
sd-daemon: extend return value logic of sd_notify()
Diffstat (limited to 'src/sd-daemon.c')
-rw-r--r--src/sd-daemon.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/sd-daemon.c b/src/sd-daemon.c
index 0dad73f94d..e6b9a6f3c2 100644
--- a/src/sd-daemon.c
+++ b/src/sd-daemon.c
@@ -344,10 +344,8 @@ int sd_notify(int unset_environment, const char *state) {
goto finish;
}
- if (!(e = getenv("NOTIFY_SOCKET"))) {
- r = 0;
- goto finish;
- }
+ if (!(e = getenv("NOTIFY_SOCKET")))
+ return 0;
/* Must be an abstract socket, or an absolute path */
if ((e[0] != '@' && e[0] != '/') || e[1] == 0) {
@@ -394,7 +392,7 @@ int sd_notify(int unset_environment, const char *state) {
goto finish;
}
- r = 0;
+ r = 1;
finish:
if (unset_environment)