Mercurial > dropbear
comparison svr-chansession.c @ 1496:da3bed08607b
fix compile warnings
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 14 Feb 2018 23:09:28 +0800 |
parents | 0c16b4ccbd54 |
children | 2d450c1056e3 |
comparison
equal
deleted
inserted
replaced
1495:0c16b4ccbd54 | 1496:da3bed08607b |
---|---|
51 static void addchildpid(struct ChanSess *chansess, pid_t pid); | 51 static void addchildpid(struct ChanSess *chansess, pid_t pid); |
52 static void sesssigchild_handler(int val); | 52 static void sesssigchild_handler(int val); |
53 static void closechansess(const struct Channel *channel); | 53 static void closechansess(const struct Channel *channel); |
54 static int newchansess(struct Channel *channel); | 54 static int newchansess(struct Channel *channel); |
55 static void chansessionrequest(struct Channel *channel); | 55 static void chansessionrequest(struct Channel *channel); |
56 static int sesscheckclose(const struct Channel *channel); | 56 static int sesscheckclose(struct Channel *channel); |
57 | 57 |
58 static void send_exitsignalstatus(const struct Channel *channel); | 58 static void send_exitsignalstatus(const struct Channel *channel); |
59 static void send_msg_chansess_exitstatus(const struct Channel * channel, | 59 static void send_msg_chansess_exitstatus(const struct Channel * channel, |
60 const struct ChanSess * chansess); | 60 const struct ChanSess * chansess); |
61 static void send_msg_chansess_exitsignal(const struct Channel * channel, | 61 static void send_msg_chansess_exitsignal(const struct Channel * channel, |
72 }; | 72 }; |
73 | 73 |
74 /* required to clear environment */ | 74 /* required to clear environment */ |
75 extern char** environ; | 75 extern char** environ; |
76 | 76 |
77 static int sesscheckclose(const struct Channel *channel) { | 77 static int sesscheckclose(struct Channel *channel) { |
78 struct ChanSess *chansess = (struct ChanSess*)channel->typedata; | 78 struct ChanSess *chansess = (struct ChanSess*)channel->typedata; |
79 TRACE(("sesscheckclose, pid is %d", chansess->exit.exitpid)) | 79 TRACE(("sesscheckclose, pid is %d", chansess->exit.exitpid)) |
80 return chansess->exit.exitpid != -1; | 80 return chansess->exit.exitpid != -1; |
81 } | 81 } |
82 | 82 |
136 * gets to run, then the childpids[] array won't have the pid in it. Hence we | 136 * gets to run, then the childpids[] array won't have the pid in it. Hence we |
137 * use the svr_ses.lastexit struct to hold the exit, which is then compared by | 137 * use the svr_ses.lastexit struct to hold the exit, which is then compared by |
138 * the parent when it runs. This work correctly at least in the case of a | 138 * the parent when it runs. This work correctly at least in the case of a |
139 * single shell spawned (ie the usual case) */ | 139 * single shell spawned (ie the usual case) */ |
140 static void sesssigchild_handler(int UNUSED(dummy)) { | 140 static void sesssigchild_handler(int UNUSED(dummy)) { |
141 unsigned int i; | |
142 struct sigaction sa_chld; | 141 struct sigaction sa_chld; |
143 | 142 |
144 const int saved_errno = errno; | 143 const int saved_errno = errno; |
145 | 144 |
146 TRACE(("enter sigchld handler")) | 145 TRACE(("enter sigchld handler")) |
903 } | 902 } |
904 | 903 |
905 /* Clean up, drop to user privileges, set up the environment and execute | 904 /* Clean up, drop to user privileges, set up the environment and execute |
906 * the command/shell. This function does not return. */ | 905 * the command/shell. This function does not return. */ |
907 static void execchild(const void *user_data) { | 906 static void execchild(const void *user_data) { |
908 struct ChanSess *chansess = user_data; | 907 const struct ChanSess *chansess = user_data; |
909 char *usershell = NULL; | 908 char *usershell = NULL; |
910 | 909 |
911 /* with uClinux we'll have vfork()ed, so don't want to overwrite the | 910 /* with uClinux we'll have vfork()ed, so don't want to overwrite the |
912 * hostkey. can't think of a workaround to clear it */ | 911 * hostkey. can't think of a workaround to clear it */ |
913 #if !DROPBEAR_VFORK | 912 #if !DROPBEAR_VFORK |