summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/session.c b/session.c
index 818f3211..04b94072 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.97 2001/06/27 02:12:53 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.98 2001/07/02 13:59:15 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1959,6 +1959,22 @@ session_close_by_pid(pid_t pid, int status)
session_close(s);
}
+int
+session_have_children(void)
+{
+ int i;
+
+ for(i = 0; i < MAX_SESSIONS; i++) {
+ Session *s = &sessions[i];
+ if (s->used && s->pid != -1) {
+ debug("session_have_children: id %d pid %d", i, s->pid);
+ return 1;
+ }
+ }
+ debug("session_have_children: no more children");
+ return 0;
+}
+
/*
* this is called when a channel dies before
* the session 'child' itself dies