comparison scp.c @ 286:92cc938b59a2

some minor cleanups to the uClinux parts
author Matt Johnston <matt@ucc.asn.au>
date Wed, 08 Mar 2006 13:48:05 +0000
parents 02a80ce2ead4
children b72f98803e46
comparison
equal deleted inserted replaced
285:1b9e69c058d2 286:92cc938b59a2
164 164
165 /* Free the reserved descriptors. */ 165 /* Free the reserved descriptors. */
166 close(reserved[0]); 166 close(reserved[0]);
167 close(reserved[1]); 167 close(reserved[1]);
168 168
169 // uClinux needs to build the args here before vforking, 169 /* uClinux needs to build the args here before vforking,
170 // otherwise we do it later on. 170 otherwise we do it later on. */
171 #ifdef __uClinux__ 171 #ifdef __uClinux__
172 args.list[0] = ssh_program; 172 args.list[0] = ssh_program;
173 if (remuser != NULL) 173 if (remuser != NULL)
174 addargs(&args, "-l%s", remuser); 174 addargs(&args, "-l%s", remuser);
175 addargs(&args, "%s", host); 175 addargs(&args, "%s", host);
210 } 210 }
211 211
212 #ifdef __uClinux__ 212 #ifdef __uClinux__
213 /* clean up command */ 213 /* clean up command */
214 /* pop cmd */ 214 /* pop cmd */
215 free(args->list[--args->num]); 215 xfree(args->list[--args->num]);
216 args->list[args->num]=NULL; 216 args->list[args->num]=NULL;
217 /* pop host */ 217 /* pop host */
218 free(args->list[--args->num-1]); 218 xfree(args->list[--args->num-1]);
219 args->list[args->num]=NULL; 219 args->list[args->num]=NULL;
220 /* pop user */ 220 /* pop user */
221 if (remuser != NULL) { 221 if (remuser != NULL) {
222 free(args->list[--args->num-1]); 222 xfree(args->list[--args->num-1]);
223 args->list[args->num]=NULL; 223 args->list[args->num]=NULL;
224 } 224 }
225 #endif /* __uClinux__ 225 #endif /* __uClinux__ */
226 226
227 /* Parent. Close the other side, and return the local side. */ 227 /* Parent. Close the other side, and return the local side. */
228 close(pin[0]); 228 close(pin[0]);
229 *fdout = pin[1]; 229 *fdout = pin[1];
230 close(pout[1]); 230 close(pout[1]);