chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: don't segfault when --log-color is passed without parameter
[elogind.git]
/
src
/
sd-daemon.c
diff --git
a/src/sd-daemon.c
b/src/sd-daemon.c
index 0dad73f94d6064e39bad7b84cadf3dea8b3f8b57..e6b9a6f3c217ca2fff601929627ac4cb648c98f4 100644
(file)
--- 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;
}
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) {
/* 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;
}
goto finish;
}
- r =
0
;
+ r =
1
;
finish:
if (unset_environment)
finish:
if (unset_environment)