diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 05:17:40 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 05:17:40 +0000 |
commit | 4983d5ebd50800edd3c7caa08a37a5206221441d (patch) | |
tree | ec169cbc9c3bf6045c974985d202375911d7c67a /session.c | |
parent | 173e646f7e04e559feb8815c27f2ffb13581d91e (diff) |
- markus@cvs.openbsd.org 2001/07/02 13:59:15
[serverloop.c session.c session.h]
wait until !session_have_children(); bugreport from
Lutz.Jaenicke@aet.TU-Cottbus.DE
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.97 2001/06/27 02:12:53 markus Exp $"); | 36 | RCSID("$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 | ||
1962 | int | ||
1963 | session_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 |