]> git.ipfire.org Git - thirdparty/systemd.git/commit
main-func: send main exit code to parent via sd_notify() on exit 14218/head
authorLennart Poettering <lennart@poettering.net>
Fri, 17 May 2019 08:17:06 +0000 (10:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Dec 2019 09:59:59 +0000 (10:59 +0100)
commit6b636c2d27908d2a49b6af7139c85a073ce4ddd0
tree76fad98868f4e1c23547cd0492878e2f459efa6c
parent8987afc4d12cce4f8b89c6d963aec8f44bf3cc45
main-func: send main exit code to parent via sd_notify() on exit

So far we silently convert negative return values from run() as
EXIT_FAILURE, which is how UNIX expects it. In many cases it would be
very useful for the caller to retrieve the actual error number we exit
with. Let's generically return that via sd_notify()'s ERRNO= attribute.
This means callers can set $NOTIFY_SOCKET and get the actual error
number delivered at their doorstep just like that.
src/shared/main-func.h