aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/individual.c2
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/cut.c2
-rw-r--r--coreutils/expand.c2
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/od_bloaty.c26
-rw-r--r--coreutils/paste.c4
-rw-r--r--coreutils/stat.c2
-rw-r--r--coreutils/stty.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/yes.c2
-rw-r--r--editors/ed.c2
-rw-r--r--editors/vi.c2
-rw-r--r--include/libbb.h1
-rw-r--r--libbb/bb_askpass.c2
-rw-r--r--libbb/dump.c2
-rw-r--r--libbb/lineedit.c8
-rw-r--r--libbb/login.c6
-rw-r--r--libbb/print_numbered_lines.c2
-rw-r--r--libbb/xfuncs_printf.c5
-rw-r--r--miscutils/bc.c2
-rw-r--r--miscutils/conspy.c4
-rw-r--r--miscutils/strings.c2
-rw-r--r--networking/brctl.c2
-rw-r--r--networking/httpd.c4
-rw-r--r--networking/libiproute/ipaddress.c14
-rw-r--r--networking/libiproute/iprule.c7
-rw-r--r--networking/udhcp/dumpleases.c2
-rw-r--r--procps/powertop.c2
-rw-r--r--procps/top.c2
-rw-r--r--shell/hush.c2
-rw-r--r--sysklogd/logread.c4
-rw-r--r--util-linux/fdisk_gpt.c4
-rw-r--r--util-linux/rev.c2
36 files changed, 69 insertions, 66 deletions
diff --git a/applets/individual.c b/applets/individual.c
index 4c468df06..e94f26c93 100644
--- a/applets/individual.c
+++ b/applets/individual.c
@@ -19,6 +19,6 @@ int main(int argc, char **argv)
19 19
20void bb_show_usage(void) 20void bb_show_usage(void)
21{ 21{
22 fputs(APPLET_full_usage "\n", stdout); 22 fputs_stdout(APPLET_full_usage "\n");
23 exit(EXIT_FAILURE); 23 exit(EXIT_FAILURE);
24} 24}
diff --git a/coreutils/cat.c b/coreutils/cat.c
index dae6089bd..4b3414941 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -152,7 +152,7 @@ static int catv(unsigned opts, char **argv)
152 eol_seen = (c == eol_char); 152 eol_seen = (c == eol_char);
153#endif 153#endif
154 visible(c, buf, opts); 154 visible(c, buf, opts);
155 fputs(buf, stdout); 155 fputs_stdout(buf);
156 } 156 }
157 } 157 }
158 if (ENABLE_FEATURE_CLEAN_UP && fd) 158 if (ENABLE_FEATURE_CLEAN_UP && fd)
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 1acbb513e..16418ff33 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -167,7 +167,7 @@ static void cut_file(FILE *file, char delim, const struct cut_list *cut_lists, u
167 * printed */ 167 * printed */
168 if (nfields_printed > 0) 168 if (nfields_printed > 0)
169 putchar(delim); 169 putchar(delim);
170 fputs(field, stdout); 170 fputs_stdout(field);
171 printed[ndelim] = 'X'; 171 printed[ndelim] = 'X';
172 nfields_printed++; /* shouldn't overflow.. */ 172 nfields_printed++; /* shouldn't overflow.. */
173 } 173 }
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 5f5993921..c5e1de6f5 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -123,7 +123,7 @@ static void expand(FILE *file, unsigned tab_size, unsigned opt)
123 } 123 }
124 ptr++; 124 ptr++;
125 } 125 }
126 fputs(ptr_strbeg, stdout); 126 fputs_stdout(ptr_strbeg);
127 free(line); 127 free(line);
128 } 128 }
129} 129}
diff --git a/coreutils/head.c b/coreutils/head.c
index 1219dfe8b..b6efabbe0 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -117,7 +117,7 @@ print_except_N_last_lines(FILE *fp, unsigned count)
117 char *c; 117 char *c;
118 if (head == count) 118 if (head == count)
119 head = 0; 119 head = 0;
120 fputs(circle[head], stdout); 120 fputs_stdout(circle[head]);
121 c = xmalloc_fgets(fp); 121 c = xmalloc_fgets(fp);
122 if (!c) 122 if (!c)
123 goto ret; 123 goto ret;
diff --git a/coreutils/id.c b/coreutils/id.c
index 78d5f2a50..f453a87ae 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -258,7 +258,7 @@ int id_main(int argc UNUSED_PARAM, char **argv)
258 bb_error_msg_and_die("can't get process context%s", 258 bb_error_msg_and_die("can't get process context%s",
259 username ? " for a different user" : ""); 259 username ? " for a different user" : "");
260 } 260 }
261 fputs(scontext, stdout); 261 fputs_stdout(scontext);
262 } 262 }
263 /* freecon(NULL) seems to be harmless */ 263 /* freecon(NULL) seems to be harmless */
264 if (ENABLE_FEATURE_CLEAN_UP) 264 if (ENABLE_FEATURE_CLEAN_UP)
diff --git a/coreutils/ls.c b/coreutils/ls.c
index e5375a61a..80ef92079 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -453,7 +453,7 @@ static unsigned print_name(const char *name)
453 name = printable_string2(&uni_stat, name); 453 name = printable_string2(&uni_stat, name);
454 454
455 if (!(option_mask32 & OPT_Q)) { 455 if (!(option_mask32 & OPT_Q)) {
456 fputs(name, stdout); 456 fputs_stdout(name);
457 return uni_stat.unicode_width; 457 return uni_stat.unicode_width;
458 } 458 }
459 459
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index d5bd7bfe8..5b5e56a21 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -422,19 +422,19 @@ print_named_ascii(size_t n_bytes, const char *block,
422 422
423 masked_c &= 0x7f; 423 masked_c &= 0x7f;
424 if (masked_c == 0x7f) { 424 if (masked_c == 0x7f) {
425 fputs(" del", stdout); 425 fputs_stdout(" del");
426 continue; 426 continue;
427 } 427 }
428 if (masked_c > ' ') { 428 if (masked_c > ' ') {
429 buf[3] = masked_c; 429 buf[3] = masked_c;
430 fputs(buf, stdout); 430 fputs_stdout(buf);
431 continue; 431 continue;
432 } 432 }
433 /* Why? Because printf(" %3.3s") is much slower... */ 433 /* Why? Because printf(" %3.3s") is much slower... */
434 buf[6] = charname[masked_c][0]; 434 buf[6] = charname[masked_c][0];
435 buf[7] = charname[masked_c][1]; 435 buf[7] = charname[masked_c][1];
436 buf[8] = charname[masked_c][2]; 436 buf[8] = charname[masked_c][2];
437 fputs(buf+5, stdout); 437 fputs_stdout(buf+5);
438 } 438 }
439} 439}
440 440
@@ -451,7 +451,7 @@ print_ascii(size_t n_bytes, const char *block,
451 451
452 if (ISPRINT(c)) { 452 if (ISPRINT(c)) {
453 buf[3] = c; 453 buf[3] = c;
454 fputs(buf, stdout); 454 fputs_stdout(buf);
455 continue; 455 continue;
456 } 456 }
457 switch (c) { 457 switch (c) {
@@ -485,7 +485,7 @@ print_ascii(size_t n_bytes, const char *block,
485 buf[8] = (c & 7) + '0'; 485 buf[8] = (c & 7) + '0';
486 s = buf + 5; 486 s = buf + 5;
487 } 487 }
488 fputs(s, stdout); 488 fputs_stdout(s);
489 } 489 }
490} 490}
491 491
@@ -881,7 +881,7 @@ format_address_label(off_t address, char c)
881static void 881static void
882dump_hexl_mode_trailer(size_t n_bytes, const char *block) 882dump_hexl_mode_trailer(size_t n_bytes, const char *block)
883{ 883{
884 fputs(" >", stdout); 884 fputs_stdout(" >");
885 while (n_bytes--) { 885 while (n_bytes--) {
886 unsigned c = *(unsigned char *) block++; 886 unsigned c = *(unsigned char *) block++;
887 c = (ISPRINT(c) ? c : '.'); 887 c = (ISPRINT(c) ? c : '.');
@@ -1121,13 +1121,13 @@ dump_strings(off_t address, off_t end_offset)
1121 1121
1122 for (i = 0; (c = buf[i]); i++) { 1122 for (i = 0; (c = buf[i]); i++) {
1123 switch (c) { 1123 switch (c) {
1124 case '\007': fputs("\\a", stdout); break; 1124 case '\007': fputs_stdout("\\a"); break;
1125 case '\b': fputs("\\b", stdout); break; 1125 case '\b': fputs_stdout("\\b"); break;
1126 case '\f': fputs("\\f", stdout); break; 1126 case '\f': fputs_stdout("\\f"); break;
1127 case '\n': fputs("\\n", stdout); break; 1127 case '\n': fputs_stdout("\\n"); break;
1128 case '\r': fputs("\\r", stdout); break; 1128 case '\r': fputs_stdout("\\r"); break;
1129 case '\t': fputs("\\t", stdout); break; 1129 case '\t': fputs_stdout("\\t"); break;
1130 case '\v': fputs("\\v", stdout); break; 1130 case '\v': fputs_stdout("\\v"); break;
1131 default: putchar(c); 1131 default: putchar(c);
1132 } 1132 }
1133 } 1133 }
diff --git a/coreutils/paste.c b/coreutils/paste.c
index fd2aa5027..7def4de11 100644
--- a/coreutils/paste.c
+++ b/coreutils/paste.c
@@ -53,7 +53,7 @@ static void paste_files(FILE** files, int file_cnt, char* delims, int del_cnt)
53 --active_files; 53 --active_files;
54 continue; 54 continue;
55 } 55 }
56 fputs(line, stdout); 56 fputs_stdout(line);
57 free(line); 57 free(line);
58 delim = '\n'; 58 delim = '\n';
59 if (i != file_cnt - 1) { 59 if (i != file_cnt - 1) {
@@ -79,7 +79,7 @@ static void paste_files_separate(FILE** files, char* delims, int del_cnt)
79 line = NULL; 79 line = NULL;
80 while ((next_line = xmalloc_fgetline(files[i])) != NULL) { 80 while ((next_line = xmalloc_fgetline(files[i])) != NULL) {
81 if (line) { 81 if (line) {
82 fputs(line, stdout); 82 fputs_stdout(line);
83 free(line); 83 free(line);
84 delim = delims[del_idx++]; 84 delim = delims[del_idx++];
85 if (del_idx == del_cnt) 85 if (del_idx == del_cnt)
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 073b2c67b..a8393468e 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -439,7 +439,7 @@ static void print_it(const char *masterformat,
439 439
440 /* print preceding string */ 440 /* print preceding string */
441 *p = '\0'; 441 *p = '\0';
442 fputs(b, stdout); 442 fputs_stdout(b);
443 443
444 p += len; 444 p += len;
445 b = p + 1; 445 b = p + 1;
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 19253964c..ba2b78317 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -855,7 +855,7 @@ static void wrapf(const char *message, ...)
855 } 855 }
856 } 856 }
857 } 857 }
858 fputs(buf, stdout); 858 fputs_stdout(buf);
859 G.current_col += buflen; 859 G.current_col += buflen;
860 if (buf[buflen-1] == '\n') 860 if (buf[buflen-1] == '\n')
861 G.current_col = 0; 861 G.current_col = 0;
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 164b208ea..02b037276 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -319,7 +319,7 @@ int baseNUM_main(int argc UNUSED_PARAM, char **argv)
319 } 319 }
320 320
321 if (col == 0) { 321 if (col == 0) {
322 fputs(dst_buf, stdout); 322 fputs_stdout(dst_buf);
323 } else { 323 } else {
324 char *result = dst_buf; 324 char *result = dst_buf;
325 if (rem == 0) 325 if (rem == 0)
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 9a435a761..0ad25926f 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -43,7 +43,7 @@ int yes_main(int argc UNUSED_PARAM, char **argv)
43 do { 43 do {
44 pp = argv; 44 pp = argv;
45 while (1) { 45 while (1) {
46 fputs(*pp, stdout); 46 fputs_stdout(*pp);
47 if (!*++pp) 47 if (!*++pp)
48 break; 48 break;
49 putchar(' '); 49 putchar(' ');
diff --git a/editors/ed.c b/editors/ed.c
index d3ae8da92..c50faeefa 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -553,7 +553,7 @@ static int printLines(int num1, int num2, int expandFlag)
553 fputc_printable(ch | PRINTABLE_META, stdout); 553 fputc_printable(ch | PRINTABLE_META, stdout);
554 } 554 }
555 555
556 fputs("$\n", stdout); 556 fputs_stdout("$\n");
557 557
558 setCurNum(num1++); 558 setCurNum(num1++);
559 lp = lp->next; 559 lp = lp->next;
diff --git a/editors/vi.c b/editors/vi.c
index adfb2b87c..458ca6293 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -522,7 +522,7 @@ static void show_help(void)
522 522
523static void write1(const char *out) 523static void write1(const char *out)
524{ 524{
525 fputs(out, stdout); 525 fputs_stdout(out);
526} 526}
527 527
528#if ENABLE_FEATURE_VI_WIN_RESIZE 528#if ENABLE_FEATURE_VI_WIN_RESIZE
diff --git a/include/libbb.h b/include/libbb.h
index cb6336474..135d9111d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -874,6 +874,7 @@ char *xmalloc_substitute_string(const char *src, int count, const char *sub, con
874int bb_putchar(int ch) FAST_FUNC; 874int bb_putchar(int ch) FAST_FUNC;
875/* Note: does not use stdio, writes to fd 2 directly */ 875/* Note: does not use stdio, writes to fd 2 directly */
876int bb_putchar_stderr(char ch) FAST_FUNC; 876int bb_putchar_stderr(char ch) FAST_FUNC;
877int fputs_stdout(const char *s) FAST_FUNC;
877char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; 878char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC;
878char *auto_string(char *str) FAST_FUNC; 879char *auto_string(char *str) FAST_FUNC;
879// gcc-4.1.1 still isn't good enough at optimizing it 880// gcc-4.1.1 still isn't good enough at optimizing it
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c
index 2dcead35a..66d6a479e 100644
--- a/libbb/bb_askpass.c
+++ b/libbb/bb_askpass.c
@@ -25,7 +25,7 @@ char* FAST_FUNC bb_ask_noecho(int fd, int timeout, const char *prompt)
25 /* Was buggy: was printing prompt *before* flushing input, 25 /* Was buggy: was printing prompt *before* flushing input,
26 * which was upsetting "expect" based scripts of some users. 26 * which was upsetting "expect" based scripts of some users.
27 */ 27 */
28 fputs(prompt, stdout); 28 fputs_stdout(prompt);
29 fflush_all(); 29 fflush_all();
30 30
31 tcgetattr(fd, &oldtio); 31 tcgetattr(fd, &oldtio);
diff --git a/libbb/dump.c b/libbb/dump.c
index 1ba1132b3..fb7849e7d 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -560,7 +560,7 @@ static void display(priv_dumper_t* dumper)
560 ) { 560 ) {
561 if (dumper->pub.eofstring) { 561 if (dumper->pub.eofstring) {
562 /* xxd support: requested to not pad incomplete blocks */ 562 /* xxd support: requested to not pad incomplete blocks */
563 fputs(dumper->pub.eofstring, stdout); 563 fputs_stdout(dumper->pub.eofstring);
564 return; 564 return;
565 } 565 }
566 if (!(pr->flags & (F_TEXT | F_BPAD))) 566 if (!(pr->flags & (F_TEXT | F_BPAD)))
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 75de88e77..367396b91 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -312,7 +312,7 @@ static void BB_PUTCHAR(wchar_t c)
312 ssize_t len = wcrtomb(buf, c, &mbst); 312 ssize_t len = wcrtomb(buf, c, &mbst);
313 if (len > 0) { 313 if (len > 0) {
314 buf[len] = '\0'; 314 buf[len] = '\0';
315 fputs(buf, stdout); 315 fputs_stdout(buf);
316 } 316 }
317 } else { 317 } else {
318 /* In this case, c is always one byte */ 318 /* In this case, c is always one byte */
@@ -460,7 +460,7 @@ static void beep(void)
460 */ 460 */
461static void put_prompt_custom(bool is_full) 461static void put_prompt_custom(bool is_full)
462{ 462{
463 fputs((is_full ? cmdedit_prompt : prompt_last_line), stdout); 463 fputs_stdout((is_full ? cmdedit_prompt : prompt_last_line));
464 cursor = 0; 464 cursor = 0;
465 cmdedit_y = cmdedit_prmt_len / cmdedit_termw; /* new quasireal y */ 465 cmdedit_y = cmdedit_prmt_len / cmdedit_termw; /* new quasireal y */
466 cmdedit_x = cmdedit_prmt_len % cmdedit_termw; 466 cmdedit_x = cmdedit_prmt_len % cmdedit_termw;
@@ -1851,7 +1851,7 @@ static void ask_terminal(void)
1851 pfd.events = POLLIN; 1851 pfd.events = POLLIN;
1852 if (safe_poll(&pfd, 1, 0) == 0) { 1852 if (safe_poll(&pfd, 1, 0) == 0) {
1853 S.sent_ESC_br6n = 1; 1853 S.sent_ESC_br6n = 1;
1854 fputs(ESC"[6n", stdout); 1854 fputs_stdout(ESC"[6n");
1855 fflush_all(); /* make terminal see it ASAP! */ 1855 fflush_all(); /* make terminal see it ASAP! */
1856 } 1856 }
1857} 1857}
@@ -2957,7 +2957,7 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
2957#undef read_line_input 2957#undef read_line_input
2958int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize) 2958int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize)
2959{ 2959{
2960 fputs(prompt, stdout); 2960 fputs_stdout(prompt);
2961 fflush_all(); 2961 fflush_all();
2962 if (!fgets(command, maxsize, stdin)) 2962 if (!fgets(command, maxsize, stdin))
2963 return -1; 2963 return -1;
diff --git a/libbb/login.c b/libbb/login.c
index 7f593d80d..af860c277 100644
--- a/libbb/login.c
+++ b/libbb/login.c
@@ -120,7 +120,7 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty)
120 buf[0] = c; 120 buf[0] = c;
121 } 121 }
122 } 122 }
123 fputs(outbuf, stdout); 123 fputs_stdout(outbuf);
124 } 124 }
125 fclose(fp); 125 fclose(fp);
126 fflush_all(); 126 fflush_all();
@@ -130,8 +130,8 @@ void FAST_FUNC print_login_prompt(void)
130{ 130{
131 char *hostname = safe_gethostname(); 131 char *hostname = safe_gethostname();
132 132
133 fputs(hostname, stdout); 133 fputs_stdout(hostname);
134 fputs(LOGIN, stdout); 134 fputs_stdout(LOGIN);
135 fflush_all(); 135 fflush_all();
136 free(hostname); 136 free(hostname);
137} 137}
diff --git a/libbb/print_numbered_lines.c b/libbb/print_numbered_lines.c
index 4758068a4..b64f85597 100644
--- a/libbb/print_numbered_lines.c
+++ b/libbb/print_numbered_lines.c
@@ -25,7 +25,7 @@ int FAST_FUNC print_numbered_lines(struct number_state *ns, const char *filename
25 printf("%*u%s", ns->width, N, ns->sep); 25 printf("%*u%s", ns->width, N, ns->sep);
26 N += ns->inc; 26 N += ns->inc;
27 } else if (ns->empty_str) 27 } else if (ns->empty_str)
28 fputs(ns->empty_str, stdout); 28 fputs_stdout(ns->empty_str);
29 puts(line); 29 puts(line);
30 free(line); 30 free(line);
31 } 31 }
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 99596b9d0..f0399ca45 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -318,6 +318,11 @@ int FAST_FUNC bb_putchar(int ch)
318 return putchar(ch); 318 return putchar(ch);
319} 319}
320 320
321int FAST_FUNC fputs_stdout(const char *s)
322{
323 return fputs(s, stdout);
324}
325
321/* Die with an error message if we can't copy an entire FILE* to stdout, 326/* Die with an error message if we can't copy an entire FILE* to stdout,
322 * then close that file. */ 327 * then close that file. */
323void FAST_FUNC xprint_and_close_file(FILE *file) 328void FAST_FUNC xprint_and_close_file(FILE *file)
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 53eb5c799..02a61ac49 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -6448,7 +6448,7 @@ static BC_STATUS zdc_program_printStream(void)
6448 char *str; 6448 char *str;
6449 idx = (r->t == XC_RESULT_STR) ? r->d.id.idx : n->rdx; 6449 idx = (r->t == XC_RESULT_STR) ? r->d.id.idx : n->rdx;
6450 str = *xc_program_str(idx); 6450 str = *xc_program_str(idx);
6451 fputs(str, stdout); 6451 fputs_stdout(str);
6452 } 6452 }
6453 6453
6454 RETURN_STATUS(s); 6454 RETURN_STATUS(s);
diff --git a/miscutils/conspy.c b/miscutils/conspy.c
index fac11d339..21a498d0f 100644
--- a/miscutils/conspy.c
+++ b/miscutils/conspy.c
@@ -107,8 +107,8 @@ enum {
107 107
108static void putcsi(const char *s) 108static void putcsi(const char *s)
109{ 109{
110 fputs(ESC"[", stdout); 110 fputs_stdout(ESC"[");
111 fputs(s, stdout); 111 fputs_stdout(s);
112} 112}
113 113
114static void clrscr(void) 114static void clrscr(void)
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 51412f401..e4a68227e 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -92,7 +92,7 @@ int strings_main(int argc UNUSED_PARAM, char **argv)
92 if (option_mask32 & (PRINT_OFFSET | PRINT_RADIX)) { 92 if (option_mask32 & (PRINT_OFFSET | PRINT_RADIX)) {
93 printf(radix_fmt, offset - n); 93 printf(radix_fmt, offset - n);
94 } 94 }
95 fputs(string, stdout); 95 fputs_stdout(string);
96 } 96 }
97 count++; 97 count++;
98 } 98 }
diff --git a/networking/brctl.c b/networking/brctl.c
index f057f9b60..e1f3e6445 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -156,7 +156,7 @@ static int show_bridge(const char *name, int need_hdr)
156 else 156 else
157 if (LONE_CHAR(filedata, '1')) 157 if (LONE_CHAR(filedata, '1'))
158 strcpy(filedata, "yes"); 158 strcpy(filedata, "yes");
159 fputs(filedata, stdout); 159 fputs_stdout(filedata);
160 160
161 /* sfx points past "BR/bridge/", turn it into "BR/brif": */ 161 /* sfx points past "BR/bridge/", turn it into "BR/brif": */
162 sfx[-4] = 'f'; sfx[-3] = '\0'; 162 sfx[-4] = 'f'; sfx[-3] = '\0';
diff --git a/networking/httpd.c b/networking/httpd.c
index 3cad28921..e6757d943 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -2788,12 +2788,12 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
2788 , &verbose 2788 , &verbose
2789 ); 2789 );
2790 if (opt & OPT_DECODE_URL) { 2790 if (opt & OPT_DECODE_URL) {
2791 fputs(percent_decode_in_place(url_for_decode, /*strict:*/ 0), stdout); 2791 fputs_stdout(percent_decode_in_place(url_for_decode, /*strict:*/ 0));
2792 return 0; 2792 return 0;
2793 } 2793 }
2794#if ENABLE_FEATURE_HTTPD_ENCODE_URL_STR 2794#if ENABLE_FEATURE_HTTPD_ENCODE_URL_STR
2795 if (opt & OPT_ENCODE_URL) { 2795 if (opt & OPT_ENCODE_URL) {
2796 fputs(encodeString(url_for_encode), stdout); 2796 fputs_stdout(encodeString(url_for_encode));
2797 return 0; 2797 return 0;
2798 } 2798 }
2799#endif 2799#endif
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index dfd84c000..17a838411 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -192,20 +192,20 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n)
192 printf("%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1)); 192 printf("%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1));
193 193
194 if (tb[IFLA_ADDRESS]) { 194 if (tb[IFLA_ADDRESS]) {
195 fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]), 195 fputs_stdout(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]),
196 RTA_PAYLOAD(tb[IFLA_ADDRESS]), 196 RTA_PAYLOAD(tb[IFLA_ADDRESS]),
197 ifi->ifi_type, 197 ifi->ifi_type,
198 b1, sizeof(b1)), stdout); 198 b1, sizeof(b1)));
199 } 199 }
200 if (tb[IFLA_BROADCAST]) { 200 if (tb[IFLA_BROADCAST]) {
201 if (ifi->ifi_flags & IFF_POINTOPOINT) 201 if (ifi->ifi_flags & IFF_POINTOPOINT)
202 printf(" peer "); 202 printf(" peer ");
203 else 203 else
204 printf(" brd "); 204 printf(" brd ");
205 fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]), 205 fputs_stdout(ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]),
206 RTA_PAYLOAD(tb[IFLA_BROADCAST]), 206 RTA_PAYLOAD(tb[IFLA_BROADCAST]),
207 ifi->ifi_type, 207 ifi->ifi_type,
208 b1, sizeof(b1)), stdout); 208 b1, sizeof(b1)));
209 } 209 }
210 } 210 }
211 bb_putchar('\n'); 211 bb_putchar('\n');
@@ -307,9 +307,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
307 printf(" family %d ", ifa->ifa_family); 307 printf(" family %d ", ifa->ifa_family);
308 308
309 if (rta_tb[IFA_LOCAL]) { 309 if (rta_tb[IFA_LOCAL]) {
310 fputs(rt_addr_n2a(ifa->ifa_family, RTA_DATA(rta_tb[IFA_LOCAL])), 310 fputs_stdout(rt_addr_n2a(ifa->ifa_family, RTA_DATA(rta_tb[IFA_LOCAL])));
311 stdout
312 );
313 311
314 if (rta_tb[IFA_ADDRESS] == NULL 312 if (rta_tb[IFA_ADDRESS] == NULL
315 || memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0 313 || memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0
@@ -363,7 +361,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
363 if (ifa_flags) 361 if (ifa_flags)
364 printf("flags %02x ", ifa_flags); 362 printf("flags %02x ", ifa_flags);
365 if (rta_tb[IFA_LABEL]) 363 if (rta_tb[IFA_LABEL])
366 fputs((char*)RTA_DATA(rta_tb[IFA_LABEL]), stdout); 364 fputs_stdout((char*)RTA_DATA(rta_tb[IFA_LABEL]));
367 if (rta_tb[IFA_CACHEINFO]) { 365 if (rta_tb[IFA_CACHEINFO]) {
368 struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]); 366 struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]);
369 char buf[128]; 367 char buf[128];
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index 50acfe4e7..a23a00d87 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -88,10 +88,9 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
88 r->rtm_src_len 88 r->rtm_src_len
89 ); 89 );
90 } else { 90 } else {
91 fputs(format_host(r->rtm_family, 91 fputs_stdout(format_host(r->rtm_family,
92 RTA_PAYLOAD(tb[RTA_SRC]), 92 RTA_PAYLOAD(tb[RTA_SRC]),
93 RTA_DATA(tb[RTA_SRC])), 93 RTA_DATA(tb[RTA_SRC]))
94 stdout
95 ); 94 );
96 } 95 }
97 } else if (r->rtm_src_len) { 96 } else if (r->rtm_src_len) {
@@ -178,7 +177,7 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
178 } else 177 } else
179 printf("masquerade"); 178 printf("masquerade");
180 } else if (r->rtm_type != RTN_UNICAST) 179 } else if (r->rtm_type != RTN_UNICAST)
181 fputs(rtnl_rtntype_n2a(r->rtm_type), stdout); 180 fputs_stdout(rtnl_rtntype_n2a(r->rtm_type));
182 181
183 bb_putchar('\n'); 182 bb_putchar('\n');
184 /*fflush_all();*/ 183 /*fflush_all();*/
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index 1e9405205..19606c58e 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -112,7 +112,7 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv)
112 printf("%02u:%02u:%02u\n", h, m, (unsigned)expires); 112 printf("%02u:%02u:%02u\n", h, m, (unsigned)expires);
113 } else { /* -a */ 113 } else { /* -a */
114 time_t t = expires_abs; 114 time_t t = expires_abs;
115 fputs(ctime(&t), stdout); 115 fputs_stdout(ctime(&t));
116 } 116 }
117 } 117 }
118 /* close(fd); */ 118 /* close(fd); */
diff --git a/procps/powertop.c b/procps/powertop.c
index d508b5f78..fc6018b7a 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -818,7 +818,7 @@ int powertop_main(int argc UNUSED_PARAM, char UNUSED_PARAM **argv)
818 818
819 for (i = 0; i < MAX_CSTATE_COUNT + 2; i++) 819 for (i = 0; i < MAX_CSTATE_COUNT + 2; i++)
820 if (cstate_lines[i][0]) 820 if (cstate_lines[i][0])
821 fputs(cstate_lines[i], stdout); 821 fputs_stdout(cstate_lines[i]);
822 822
823 i = process_timer_stats(); 823 i = process_timer_stats();
824#if ENABLE_FEATURE_POWERTOP_PROCIRQ 824#if ENABLE_FEATURE_POWERTOP_PROCIRQ
diff --git a/procps/top.c b/procps/top.c
index 8d39526ff..cadc4ecec 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -712,7 +712,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
712 ); 712 );
713 if ((int)(scr_width - col) > 1) 713 if ((int)(scr_width - col) > 1)
714 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm); 714 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm);
715 fputs(line_buf, stdout); 715 fputs_stdout(line_buf);
716 /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu, 716 /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu,
717 cur_jif.busy - prev_jif.busy, cur_jif.total - prev_jif.total); */ 717 cur_jif.busy - prev_jif.busy, cur_jif.total - prev_jif.total); */
718 s++; 718 s++;
diff --git a/shell/hush.c b/shell/hush.c
index 77f90f82f..5eb6fa396 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2692,7 +2692,7 @@ static int get_user_input(struct in_str *i)
2692 * Without check_and_run_traps, handler never runs. 2692 * Without check_and_run_traps, handler never runs.
2693 */ 2693 */
2694 check_and_run_traps(); 2694 check_and_run_traps();
2695 fputs(prompt_str, stdout); 2695 fputs_stdout(prompt_str);
2696 fflush_all(); 2696 fflush_all();
2697 } 2697 }
2698 r = hfgetc(i->file); 2698 r = hfgetc(i->file);
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index b52dc9cac..d5f8ca0a2 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -205,7 +205,7 @@ int logread_main(int argc UNUSED_PARAM, char **argv)
205 cur = shbuf_tail; 205 cur = shbuf_tail;
206#else 206#else
207 while (cur != shbuf_tail) { 207 while (cur != shbuf_tail) {
208 fputs(shbuf_data + cur, stdout); 208 fputs_stdout(shbuf_data + cur);
209 cur += strlen(shbuf_data + cur) + 1; 209 cur += strlen(shbuf_data + cur) + 1;
210 if (cur >= shbuf_size) 210 if (cur >= shbuf_size)
211 cur = 0; 211 cur = 0;
@@ -217,7 +217,7 @@ int logread_main(int argc UNUSED_PARAM, char **argv)
217 217
218#if ENABLE_FEATURE_LOGREAD_REDUCED_LOCKING 218#if ENABLE_FEATURE_LOGREAD_REDUCED_LOCKING
219 for (i = 0; i < len_total; i += strlen(copy + i) + 1) { 219 for (i = 0; i < len_total; i += strlen(copy + i) + 1) {
220 fputs(copy + i, stdout); 220 fputs_stdout(copy + i);
221 } 221 }
222 free(copy); 222 free(copy);
223#endif 223#endif
diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c
index e884e3dc1..4c30f31f8 100644
--- a/util-linux/fdisk_gpt.c
+++ b/util-linux/fdisk_gpt.c
@@ -87,7 +87,7 @@ gpt_print_wide36(uint16_t *s)
87 } 87 }
88 wc[i] = 0; 88 wc[i] = 0;
89 if (wcstombs(buf, wc, sizeof(buf)) <= sizeof(buf)-1) 89 if (wcstombs(buf, wc, sizeof(buf)) <= sizeof(buf)-1)
90 fputs(printable_string(buf), stdout); 90 fputs_stdout(printable_string(buf));
91#else 91#else
92 char buf[37]; 92 char buf[37];
93 int i = 0; 93 int i = 0;
@@ -98,7 +98,7 @@ gpt_print_wide36(uint16_t *s)
98 i++; 98 i++;
99 } 99 }
100 buf[i] = '\0'; 100 buf[i] = '\0';
101 fputs(buf, stdout); 101 fputs_stdout(buf);
102#endif 102#endif
103} 103}
104 104
diff --git a/util-linux/rev.c b/util-linux/rev.c
index ede4fbc9c..d439b4da8 100644
--- a/util-linux/rev.c
+++ b/util-linux/rev.c
@@ -108,7 +108,7 @@ int rev_main(int argc UNUSED_PARAM, char **argv)
108#else 108#else
109 strrev(buf, strlen(buf)); 109 strrev(buf, strlen(buf));
110#endif 110#endif
111 fputs(buf, stdout); 111 fputs_stdout(buf);
112 } 112 }
113 fclose(fp); 113 fclose(fp);
114 } while (*argv); 114 } while (*argv);