diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-04-09 13:04:50 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-04-09 13:04:50 +0000 |
commit | 68a4a5b8a86e3c0f0f371e6d3ad04cb513f10d19 (patch) | |
tree | 9aa16703d48b9a7a38ccaec3759a19e95e976383 /libbb/vfork_daemon_rexec.c | |
parent | 4565afa16cb2dd94d5aac41b6627e0a5240fbbe0 (diff) | |
download | busybox-w32-68a4a5b8a86e3c0f0f371e6d3ad04cb513f10d19.tar.gz busybox-w32-68a4a5b8a86e3c0f0f371e6d3ad04cb513f10d19.tar.bz2 busybox-w32-68a4a5b8a86e3c0f0f371e6d3ad04cb513f10d19.zip |
Implement first instance of NOFORK applet - echo
find: use NOFORK/NOEXEC; small -exec buglet also eliminated
vfork_daemon_rexec: honor PREFER_APPLETS
echo: small size improvements
find -exec echo {} \; with PREFER_APPLETS=y runs 4 times faster
git-svn-id: svn://busybox.net/trunk/busybox@18372 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index ec8b9b1d7..11dbb24fc 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c | |||
@@ -26,14 +26,16 @@ pid_t spawn(char **argv) | |||
26 | volatile int failed; | 26 | volatile int failed; |
27 | pid_t pid; | 27 | pid_t pid; |
28 | 28 | ||
29 | // Be nice to nommu machines. | 29 | // Ain't it a good place to fflush(NULL)? |
30 | |||
31 | /* Be nice to nommu machines. */ | ||
30 | failed = 0; | 32 | failed = 0; |
31 | pid = vfork(); | 33 | pid = vfork(); |
32 | if (pid < 0) /* error */ | 34 | if (pid < 0) /* error */ |
33 | return pid; | 35 | return pid; |
34 | if (!pid) { /* child */ | 36 | if (!pid) { /* child */ |
35 | /* Don't use BB_EXECVP tricks here! */ | 37 | /* This macro is ok - it doesn't do NOEXEC/NOFORK tricks */ |
36 | execvp(argv[0], argv); | 38 | BB_EXECVP(argv[0], argv); |
37 | 39 | ||
38 | /* We are (maybe) sharing a stack with blocked parent, | 40 | /* We are (maybe) sharing a stack with blocked parent, |
39 | * let parent know we failed and then exit to unblock parent | 41 | * let parent know we failed and then exit to unblock parent |