comparison svr-chansession.c @ 402:173a5f89666c channel-fix

propagate from branch 'au.asn.ucc.matt.dropbear' (head b1dd3b94e60a07a176dba2b035ac79968595990a) to branch 'au.asn.ucc.matt.dropbear.channel-fix' (head fc77c3dea87a7c0f374e738d055f0b455495cbc3)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 08:22:58 +0000
parents 59c7938af2bd a5bca950120d
children a01c0c8e543a
comparison
equal deleted inserted replaced
399:a707e6148060 402:173a5f89666c
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 struct ChanSess *chansess = (struct ChanSess*)channel->typedata; 69 struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
71 return chansess->exit.exitpid >= 0; 70 return chansess->exit.exitpid != -1;
72 } 71 }
73 72
74 /* 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 */
75 74
76 /* 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