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 818f3211b..04b940721 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.97 2001/06/27 02:12:53 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.98 2001/07/02 13:59:15 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -1959,6 +1959,22 @@ session_close_by_pid(pid_t pid, int status)
1959 session_close(s); 1959 session_close(s);
1960} 1960}
1961 1961
1962int
1963session_have_children(void)
1964{
1965 int i;
1966
1967 for(i = 0; i < MAX_SESSIONS; i++) {
1968 Session *s = &sessions[i];
1969 if (s->used && s->pid != -1) {
1970 debug("session_have_children: id %d pid %d", i, s->pid);
1971 return 1;
1972 }
1973 }
1974 debug("session_have_children: no more children");
1975 return 0;
1976}
1977
1962/* 1978/*
1963 * this is called when a channel dies before 1979 * this is called when a channel dies before
1964 * the session 'child' itself dies 1980 * the session 'child' itself dies