summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2017-01-27 10:47:17 +1300
committerRobert Ancell <robert.ancell@canonical.com>2017-01-27 10:47:17 +1300
commitefe8c45a10406d5f8255834ff84153be168cd8bb (patch)
tree2e84d138cb4792e484d568a89131145cee498063 /src
parente3f0752d51490c01bd24b6ae43126a1d14da54a4 (diff)
downloadlightdm-git-efe8c45a10406d5f8255834ff84153be168cd8bb.tar.gz
Correctly pass return value from sessions to LightDM
Diffstat (limited to 'src')
-rw-r--r--src/session-child.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/session-child.c b/src/session-child.c
index fb12d9b8..28986d31 100644
--- a/src/session-child.c
+++ b/src/session-child.c
@@ -722,6 +722,8 @@ session_child_run (int argc, char **argv)
/* Wait for the command to complete (blocks) */
if (child_pid > 0)
{
+ int child_status;
+
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)
{
@@ -756,8 +758,12 @@ session_child_run (int argc, char **argv)
#endif
}
- waitpid (child_pid, &return_code, 0);
+ waitpid (child_pid, &child_status, 0);
child_pid = 0;
+ if (WIFEXITED (child_status))
+ return_code = WEXITSTATUS (child_status);
+ else
+ return_code = EXIT_FAILURE;
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)