X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=miscutils%2Ftime.c;h=dbc92d12ff9d128a0478165e681b68b49bdf468b;hb=b2dc913527f2cb9a4590fe5e553bcc2c456007e0;hp=ed438594841c37c54d2c9c9247cfb7d7f05f5d78;hpb=b44c790e41e281965955a83408f35ea53ecdb3d2;p=oweals%2Fbusybox.git diff --git a/miscutils/time.c b/miscutils/time.c index ed4385948..dbc92d12f 100644 --- a/miscutils/time.c +++ b/miscutils/time.c @@ -374,7 +374,7 @@ static void run_command(char *const *cmd, resource_t *resp) resp->elapsed_ms = monotonic_us() / 1000; pid = vfork(); /* Run CMD as child process. */ if (pid < 0) - bb_error_msg_and_die("cannot fork"); + bb_perror_msg_and_die("fork"); if (pid == 0) { /* If child. */ /* Don't cast execvp arguments; that causes errors on some systems, versus merely warnings if the cast is left off. */ @@ -396,12 +396,13 @@ static void run_command(char *const *cmd, resource_t *resp) } int time_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int time_main(int argc ATTRIBUTE_UNUSED, char **argv) +int time_main(int argc UNUSED_PARAM, char **argv) { resource_t res; const char *output_format = default_format; int opt; + opt_complementary = "-1"; /* at least one arg */ /* "+": stop on first non-option */ opt = getopt32(argv, "+vp"); argv += optind; @@ -424,5 +425,5 @@ int time_main(int argc ATTRIBUTE_UNUSED, char **argv) return WTERMSIG(res.waitstatus); if (WIFEXITED(res.waitstatus)) return WEXITSTATUS(res.waitstatus); - fflush_stdout_and_exit(0); + fflush_stdout_and_exit(EXIT_SUCCESS); }