diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:08:20 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:08:20 +1000 |
commit | 6a6efd31038d7afe977e3059508ae863e65cbdf5 (patch) | |
tree | 5cd69a751e893b83176751c80fcea7a7afeed1ae /miscutils/time.c | |
parent | a6a2325ecf402054132daae169f71edb0fb849e3 (diff) | |
parent | 29082231d0cb1a5b327de5d515b16f332d4dbdaf (diff) | |
download | busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.gz busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.bz2 busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.zip |
Merge branch 'origin/master' (early part)
Diffstat (limited to 'miscutils/time.c')
-rw-r--r-- | miscutils/time.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/miscutils/time.c b/miscutils/time.c index 6946c863f..9facc3657 100644 --- a/miscutils/time.c +++ b/miscutils/time.c | |||
@@ -367,20 +367,15 @@ static void summarize(const char *fmt, char **command, resource_t *resp) | |||
367 | Put the statistics in *RESP. */ | 367 | Put the statistics in *RESP. */ |
368 | static void run_command(char *const *cmd, resource_t *resp) | 368 | static void run_command(char *const *cmd, resource_t *resp) |
369 | { | 369 | { |
370 | pid_t pid; /* Pid of child. */ | 370 | pid_t pid; |
371 | void (*interrupt_signal)(int); | 371 | void (*interrupt_signal)(int); |
372 | void (*quit_signal)(int); | 372 | void (*quit_signal)(int); |
373 | 373 | ||
374 | resp->elapsed_ms = monotonic_ms(); | 374 | resp->elapsed_ms = monotonic_ms(); |
375 | pid = vfork(); /* Run CMD as child process. */ | 375 | pid = xvfork(); |
376 | if (pid < 0) | 376 | if (pid == 0) { |
377 | bb_perror_msg_and_die("fork"); | 377 | /* Child */ |
378 | if (pid == 0) { /* If child. */ | 378 | BB_EXECVP_or_die((char**)cmd); |
379 | /* Don't cast execvp arguments; that causes errors on some systems, | ||
380 | versus merely warnings if the cast is left off. */ | ||
381 | BB_EXECVP(cmd[0], cmd); | ||
382 | xfunc_error_retval = (errno == ENOENT ? 127 : 126); | ||
383 | bb_error_msg_and_die("can't run '%s'", cmd[0]); | ||
384 | } | 379 | } |
385 | 380 | ||
386 | /* Have signals kill the child but not self (if possible). */ | 381 | /* Have signals kill the child but not self (if possible). */ |