diff options
-rw-r--r-- | man/sd_notify.xml | 7 | ||||
-rw-r--r-- | src/shared/main-func.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/man/sd_notify.xml b/man/sd_notify.xml index 39bddc9d15..f93542e329 100644 --- a/man/sd_notify.xml +++ b/man/sd_notify.xml @@ -171,6 +171,13 @@ </varlistentry> <varlistentry> + <term>EXIT_STATUS=…</term> + + <listitem><para>If a service exits, the return value of its <function>main()</function> function. + </para></listitem> + </varlistentry> + + <varlistentry> <term>MAINPID=…</term> <listitem><para>The main process ID (PID) of the service, in case the service manager did not fork diff --git a/src/shared/main-func.h b/src/shared/main-func.h index 3dc4992282..3f6b6a849d 100644 --- a/src/shared/main-func.h +++ b/src/shared/main-func.h @@ -21,6 +21,7 @@ r = impl; \ if (r < 0) \ (void) sd_notifyf(0, "ERRNO=%i", -r); \ + (void) sd_notifyf(0, "EXIT_STATUS=%i", ret); \ ask_password_agent_close(); \ polkit_agent_close(); \ pager_close(); \ |