comparison svr-chansession.c @ 367:c046b66b76cd channel-fix

propagate from branch 'au.asn.ucc.matt.dropbear' (head 31dcd7a22983ef19d6c63248e415e71d292dd0ec) to branch 'au.asn.ucc.matt.dropbear.channel-fix' (head 7559a8cc4f6abe2338636f2aced3a395a79c172c)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Oct 2006 03:01:10 +0000
parents 90cb290836de
children a5bca950120d
comparison
equal deleted inserted replaced
366:59531221b846 367:c046b66b76cd
57 static void send_exitsignalstatus(struct Channel *channel); 57 static void send_exitsignalstatus(struct Channel *channel);
58 static void send_msg_chansess_exitstatus(struct Channel * channel, 58 static void send_msg_chansess_exitstatus(struct Channel * channel,
59 struct ChanSess * chansess); 59 struct ChanSess * chansess);
60 static void send_msg_chansess_exitsignal(struct Channel * channel, 60 static void send_msg_chansess_exitsignal(struct Channel * channel,
61 struct ChanSess * chansess); 61 struct ChanSess * chansess);
62 static int sesscheckclose(struct Channel *channel);
63 static void get_termmodes(struct ChanSess *chansess); 62 static void get_termmodes(struct ChanSess *chansess);
64 63
65 64
66 /* required to clear environment */ 65 /* required to clear environment */
67 extern char** environ; 66 extern char** environ;
68 67
69 static int sesscheckclose(struct Channel *channel) { 68 static int sesscheckclose(struct Channel *channel) {
70 return channel->writefd == -1; 69 struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
70 return chansess->exit.exitpid != -1;
71 } 71 }
72 72
73 /* Handler for childs exiting, store the state for return to the client */ 73 /* Handler for childs exiting, store the state for return to the client */
74 74
75 /* There's a particular race we have to watch out for: if the forked child 75 /* There's a particular race we have to watch out for: if the forked child