summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-08 22:06:48 +1100
committerDamien Miller <djm@mindrot.org>2002-02-08 22:06:48 +1100
commitf3dcf1fc88a55a916ace325e252c6f75ff53b71b (patch)
tree71814bc7b8b2661ada45995f13ab427b501955df
parent025e01c7f0afe5cb25a57c829137a55a9d1f4352 (diff)
- markus@cvs.openbsd.org 2002/02/06 14:37:22
[session.c] minor KNF
-rw-r--r--ChangeLog5
-rw-r--r--session.c14
2 files changed, 9 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 6baf7e72e..c92df7481 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,9 @@
19 - mpech@cvs.openbsd.org 2002/02/06 14:27:23 19 - mpech@cvs.openbsd.org 2002/02/06 14:27:23
20 [sftp.c] 20 [sftp.c]
21 sync usage() with manual. 21 sync usage() with manual.
22 - markus@cvs.openbsd.org 2002/02/06 14:37:22
23 [session.c]
24 minor KNF
22 25
2320020205 2620020205
24 - (djm) Cleanup after sync: 27 - (djm) Cleanup after sync:
@@ -7525,4 +7528,4 @@
7525 - Wrote replacements for strlcpy and mkdtemp 7528 - Wrote replacements for strlcpy and mkdtemp
7526 - Released 1.0pre1 7529 - Released 1.0pre1
7527 7530
7528$Id: ChangeLog,v 1.1833 2002/02/08 11:06:29 djm Exp $ 7531$Id: ChangeLog,v 1.1834 2002/02/08 11:06:48 djm Exp $
diff --git a/session.c b/session.c
index 9bc01a06f..431936ac6 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.123 2002/02/03 17:53:25 markus Exp $"); 36RCSID("$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
1825session_exit_message(Session *s, int status) 1825session_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));