diff svr-chansession.c @ 364:90cb290836de channel-fix

Passes most test cases now
author Matt Johnston <matt@ucc.asn.au>
date Mon, 09 Oct 2006 16:31:00 +0000
parents 1c7bf9cec6c8
children a5bca950120d
line wrap: on
line diff
--- a/svr-chansession.c	Sat Oct 07 17:48:55 2006 +0000
+++ b/svr-chansession.c	Mon Oct 09 16:31:00 2006 +0000
@@ -65,6 +65,11 @@
 /* required to clear environment */
 extern char** environ;
 
+static int sesscheckclose(struct Channel *channel) {
+	struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
+	return chansess->exit.exitpid != -1;
+}
+
 /* Handler for childs exiting, store the state for return to the client */
 
 /* There's a particular race we have to watch out for: if the forked child
@@ -962,7 +967,7 @@
 	0, /* sepfds */
 	"session", /* name */
 	newchansess, /* inithandler */
-	NULL, /* checkclosehandler */
+	sesscheckclose, /* checkclosehandler */
 	chansessionrequest, /* reqhandler */
 	closechansess, /* closehandler */
 };