aboutsummaryrefslogtreecommitdiff
path: root/miscutils/time.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /miscutils/time.c
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
Major coreutils update.
Diffstat (limited to 'miscutils/time.c')
-rw-r--r--miscutils/time.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/miscutils/time.c b/miscutils/time.c
index fa352a899..c30ef4311 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -141,7 +141,7 @@ static void fprintargv (FILE *fp, char *const *argv, const char *filler)
141 fputs (*av, fp); 141 fputs (*av, fp);
142 } 142 }
143 if (ferror (fp)) 143 if (ferror (fp))
144 error_msg_and_die("write error"); 144 bb_error_msg_and_die("write error");
145} 145}
146 146
147/* Return the number of kilobytes corresponding to a number of pages PAGES. 147/* Return the number of kilobytes corresponding to a number of pages PAGES.
@@ -416,12 +416,12 @@ static void summarize (FILE *fp, const char *fmt, char **command, resource_t *re
416 } 416 }
417 417
418 if (ferror (fp)) 418 if (ferror (fp))
419 error_msg_and_die("write error"); 419 bb_error_msg_and_die("write error");
420 } 420 }
421 putc ('\n', fp); 421 putc ('\n', fp);
422 422
423 if (ferror (fp)) 423 if (ferror (fp))
424 error_msg_and_die("write error"); 424 bb_error_msg_and_die("write error");
425} 425}
426 426
427/* Run command CMD and return statistics on it. 427/* Run command CMD and return statistics on it.
@@ -434,13 +434,13 @@ static void run_command (char *const *cmd, resource_t *resp)
434 gettimeofday (&resp->start, (struct timezone *) 0); 434 gettimeofday (&resp->start, (struct timezone *) 0);
435 pid = fork (); /* Run CMD as child process. */ 435 pid = fork (); /* Run CMD as child process. */
436 if (pid < 0) 436 if (pid < 0)
437 error_msg_and_die("cannot fork"); 437 bb_error_msg_and_die("cannot fork");
438 else if (pid == 0) 438 else if (pid == 0)
439 { /* If child. */ 439 { /* If child. */
440 /* Don't cast execvp arguments; that causes errors on some systems, 440 /* Don't cast execvp arguments; that causes errors on some systems,
441 versus merely warnings if the cast is left off. */ 441 versus merely warnings if the cast is left off. */
442 execvp (cmd[0], cmd); 442 execvp (cmd[0], cmd);
443 error_msg("cannot run %s", cmd[0]); 443 bb_error_msg("cannot run %s", cmd[0]);
444 _exit (errno == ENOENT ? 127 : 126); 444 _exit (errno == ENOENT ? 127 : 126);
445 } 445 }
446 446
@@ -449,7 +449,7 @@ static void run_command (char *const *cmd, resource_t *resp)
449 quit_signal = signal (SIGQUIT, SIG_IGN); 449 quit_signal = signal (SIGQUIT, SIG_IGN);
450 450
451 if (resuse_end (pid, resp) == 0) 451 if (resuse_end (pid, resp) == 0)
452 error_msg("error waiting for child process"); 452 bb_error_msg("error waiting for child process");
453 453
454 /* Re-enable signals. */ 454 /* Re-enable signals. */
455 signal (SIGINT, interrupt_signal); 455 signal (SIGINT, interrupt_signal);
@@ -477,7 +477,7 @@ extern int time_main (int argc, char **argv)
477 output_format = posix_format; 477 output_format = posix_format;
478 break; 478 break;
479 default: 479 default:
480 show_usage(); 480 bb_show_usage();
481 } 481 }
482 argc--; 482 argc--;
483 argv++; 483 argv++;
@@ -486,7 +486,7 @@ extern int time_main (int argc, char **argv)
486 } 486 }
487 487
488 if (argv == NULL || *argv == NULL) 488 if (argv == NULL || *argv == NULL)
489 show_usage(); 489 bb_show_usage();
490 490
491 run_command (argv, &res); 491 run_command (argv, &res);
492 summarize (stdout, output_format, argv, &res); 492 summarize (stdout, output_format, argv, &res);