Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/debianutils/pipe_progress.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/debianutils/pipe_progress.c
r1765 r2725 5 5 * Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess 6 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 9 10 9 #include "libbb.h" 11 10 … … 15 14 * Activity is indicated by a '.' to stderr 16 15 */ 17 int pipe_progress_main(int argc, char **argv) ;18 int pipe_progress_main(int argc , char **argv)16 int pipe_progress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17 int pipe_progress_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 19 18 { 20 RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE);19 char buf[PIPE_PROGRESS_SIZE]; 21 20 time_t t = time(NULL); 22 size_t len;21 int len; 23 22 24 while ((len = fread(buf, 1, PIPE_PROGRESS_SIZE, stdin)) > 0) {23 while ((len = safe_read(STDIN_FILENO, buf, PIPE_PROGRESS_SIZE)) > 0) { 25 24 time_t new_time = time(NULL); 26 25 if (new_time != t) { 27 26 t = new_time; 28 fputc('.', stderr);27 bb_putchar_stderr('.'); 29 28 } 30 f write(buf, len, 1, stdout);29 full_write(STDOUT_FILENO, buf, len); 31 30 } 32 31 33 fputc('\n', stderr); 34 35 if (ENABLE_FEATURE_CLEAN_UP) 36 RELEASE_CONFIG_BUFFER(buf); 32 bb_putchar_stderr('\n'); 37 33 38 34 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.