diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.123 2002/02/03 17:53:25 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.124 2002/02/06 14:37:22 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1825,23 +1825,19 @@ static void | |||
1825 | session_exit_message(Session *s, int status) | 1825 | session_exit_message(Session *s, int status) |
1826 | { | 1826 | { |
1827 | Channel *c; | 1827 | Channel *c; |
1828 | if (s == NULL) | 1828 | |
1829 | fatal("session_close: no session"); | 1829 | if ((c = channel_lookup(s->chanid)) == NULL) |
1830 | c = channel_lookup(s->chanid); | ||
1831 | if (c == NULL) | ||
1832 | fatal("session_exit_message: session %d: no channel %d", | 1830 | fatal("session_exit_message: session %d: no channel %d", |
1833 | s->self, s->chanid); | 1831 | s->self, s->chanid); |
1834 | debug("session_exit_message: session %d channel %d pid %d", | 1832 | debug("session_exit_message: session %d channel %d pid %d", |
1835 | s->self, s->chanid, s->pid); | 1833 | s->self, s->chanid, s->pid); |
1836 | 1834 | ||
1837 | if (WIFEXITED(status)) { | 1835 | if (WIFEXITED(status)) { |
1838 | channel_request_start(s->chanid, | 1836 | channel_request_start(s->chanid, "exit-status", 0); |
1839 | "exit-status", 0); | ||
1840 | packet_put_int(WEXITSTATUS(status)); | 1837 | packet_put_int(WEXITSTATUS(status)); |
1841 | packet_send(); | 1838 | packet_send(); |
1842 | } else if (WIFSIGNALED(status)) { | 1839 | } else if (WIFSIGNALED(status)) { |
1843 | channel_request_start(s->chanid, | 1840 | channel_request_start(s->chanid, "exit-signal", 0); |
1844 | "exit-signal", 0); | ||
1845 | packet_put_int(WTERMSIG(status)); | 1841 | packet_put_int(WTERMSIG(status)); |
1846 | #ifdef WCOREDUMP | 1842 | #ifdef WCOREDUMP |
1847 | packet_put_char(WCOREDUMP(status)); | 1843 | packet_put_char(WCOREDUMP(status)); |