aboutsummaryrefslogtreecommitdiff
path: root/coreutils/yes.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-27 07:40:17 +0100
committerRon Yorston <rmy@pobox.com>2023-04-27 07:40:17 +0100
commit5eb812d75edd830fc263a04c69f4849d3336a743 (patch)
treec35c8a143bca0841e0d6cd5400185c5103d36dfb /coreutils/yes.c
parent8e6e5aa81c3bb7ce0b6a7f85ed0d01fc15604e5a (diff)
downloadbusybox-w32-5eb812d75edd830fc263a04c69f4849d3336a743.tar.gz
busybox-w32-5eb812d75edd830fc263a04c69f4849d3336a743.tar.bz2
busybox-w32-5eb812d75edd830fc263a04c69f4849d3336a743.zip
yes: detect pipe fail error
Commit 418f43bea (yes: add explicit error check for WIN32) added a call to ferror() to detect when output to a pipe failed. Now that we check for pipe failures in the winansi code we can use that instead.
Diffstat (limited to 'coreutils/yes.c')
-rw-r--r--coreutils/yes.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 64dfa500c..7eb8ac1ba 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -31,6 +31,11 @@
31 31
32#include "libbb.h" 32#include "libbb.h"
33 33
34#if ENABLE_PLATFORM_MINGW32
35# undef putchar
36# define putchar(c) winansi_fputc(c, stdout)
37#endif
38
34int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 39int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
35int yes_main(int argc UNUSED_PARAM, char **argv) 40int yes_main(int argc UNUSED_PARAM, char **argv)
36{ 41{
@@ -41,10 +46,6 @@ int yes_main(int argc UNUSED_PARAM, char **argv)
41 ++argv; 46 ++argv;
42 47
43 do { 48 do {
44#if ENABLE_PLATFORM_MINGW32
45 if (ferror(stdout) != 0)
46 break;
47#endif
48 pp = argv; 49 pp = argv;
49 while (1) { 50 while (1) {
50 fputs_stdout(*pp); 51 fputs_stdout(*pp);