summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2008-11-02 13:34:02 +0000
committerMatt Johnston <matt@ucc.asn.au>2008-11-02 13:34:02 +0000
commitebc3a3ac74024b9ee9251f90507688bef71bdb19 (patch)
tree2abc554117d01d0f385a148e80e705d44855347c /scp.c
parent5cd6995fb5ab34c3ff2e77f94be1be4135248db3 (diff)
downloaddropbear-ebc3a3ac74024b9ee9251f90507688bef71bdb19.tar.gz
- use vfork()/_exit() for uclinux
--HG-- extra : convert_revision : 1f9658a860290e6664fa9db84b9bb5b8673a1b1f
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/scp.c b/scp.c
index 1d788c9..da64dd1 100644
--- a/scp.c
+++ b/scp.c
@@ -130,13 +130,22 @@ do_local_cmd(arglist *a)
fprintf(stderr, " %s", a->list[i]);
fprintf(stderr, "\n");
}
- if ((pid = fork()) == -1)
+#ifdef __uClinux__
+ pid = vfork();
+#else
+ pid = fork();
+#endif /* __uClinux__ */
+ if (pid == -1)
fatal("do_local_cmd: fork: %s", strerror(errno));
if (pid == 0) {
execvp(a->list[0], a->list);
perror(a->list[0]);
+#ifdef __uClinux__
+ _exit(1);
+#else
exit(1);
+#endif /* __uClinux__ */
}
do_cmd_pid = pid;
@@ -225,7 +234,11 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
execvp(ssh_program, args.list);
perror(ssh_program);
+#ifndef __uClinux__
exit(1);
+#else
+ _exit(1);
+#endif /* __uClinux__ */
} else if (do_cmd_pid == -1) {
fatal("fork: %s", strerror(errno));
}