diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 16 | ||||
-rw-r--r-- | coreutils/du.c | 2 | ||||
-rw-r--r-- | coreutils/expr.c | 2 | ||||
-rw-r--r-- | coreutils/factor.c | 4 | ||||
-rw-r--r-- | coreutils/ls.c | 4 | ||||
-rw-r--r-- | coreutils/od_bloaty.c | 7 | ||||
-rw-r--r-- | coreutils/shred.c | 10 | ||||
-rw-r--r-- | coreutils/stat.c | 9 | ||||
-rw-r--r-- | coreutils/sum.c | 4 | ||||
-rw-r--r-- | coreutils/tee.c | 2 | ||||
-rw-r--r-- | coreutils/timeout.c | 53 | ||||
-rw-r--r-- | coreutils/yes.c | 4 |
12 files changed, 106 insertions, 11 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 0f130bcad..d29357dae 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -86,6 +86,9 @@ | |||
86 | //usage: "\n status=none Suppress all output" | 86 | //usage: "\n status=none Suppress all output" |
87 | //usage: ) | 87 | //usage: ) |
88 | //usage: "\n" | 88 | //usage: "\n" |
89 | //usage: IF_PLATFORM_MINGW32( | ||
90 | //usage: "\nif=/dev/zero and if=/dev/urandom are supported" | ||
91 | //usage: ) | ||
89 | //usage: "\nN may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G" | 92 | //usage: "\nN may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G" |
90 | //usage: | 93 | //usage: |
91 | //usage:#define dd_example_usage | 94 | //usage:#define dd_example_usage |
@@ -353,11 +356,11 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
353 | #if ENABLE_FEATURE_DD_IBS_OBS | 356 | #if ENABLE_FEATURE_DD_IBS_OBS |
354 | if (what == OP_ibs) { | 357 | if (what == OP_ibs) { |
355 | /* Must fit into positive ssize_t */ | 358 | /* Must fit into positive ssize_t */ |
356 | ibs = xatoul_range_sfx(val, 1, ((size_t)-1L)/2, cwbkMG_suffixes); | 359 | ibs = xatoul_range_sfx(val, 1, ULONG_MAX/2, cwbkMG_suffixes); |
357 | /*continue;*/ | 360 | /*continue;*/ |
358 | } | 361 | } |
359 | if (what == OP_obs) { | 362 | if (what == OP_obs) { |
360 | obs = xatoul_range_sfx(val, 1, ((size_t)-1L)/2, cwbkMG_suffixes); | 363 | obs = xatoul_range_sfx(val, 1, ULONG_MAX/2, cwbkMG_suffixes); |
361 | /*continue;*/ | 364 | /*continue;*/ |
362 | } | 365 | } |
363 | if (what == OP_conv) { | 366 | if (what == OP_conv) { |
@@ -370,7 +373,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
370 | } | 373 | } |
371 | #endif | 374 | #endif |
372 | if (what == OP_bs) { | 375 | if (what == OP_bs) { |
373 | ibs = xatoul_range_sfx(val, 1, ((size_t)-1L)/2, cwbkMG_suffixes); | 376 | ibs = xatoul_range_sfx(val, 1, ULONG_MAX/2, cwbkMG_suffixes); |
374 | obs = ibs; | 377 | obs = ibs; |
375 | /*continue;*/ | 378 | /*continue;*/ |
376 | } | 379 | } |
@@ -426,7 +429,12 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
426 | #endif | 429 | #endif |
427 | 430 | ||
428 | if (infile) { | 431 | if (infile) { |
432 | #if !ENABLE_PLATFORM_MINGW32 | ||
429 | xmove_fd(xopen(infile, O_RDONLY), ifd); | 433 | xmove_fd(xopen(infile, O_RDONLY), ifd); |
434 | #else | ||
435 | xmove_fd(mingw_xopen(infile, O_RDONLY), ifd); | ||
436 | update_dev_fd(get_dev_type(infile), ifd); | ||
437 | #endif | ||
430 | } else { | 438 | } else { |
431 | infile = bb_msg_standard_input; | 439 | infile = bb_msg_standard_input; |
432 | } | 440 | } |
@@ -478,6 +486,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
478 | 486 | ||
479 | while (!(G.flags & FLAG_COUNT) || (G.in_full + G.in_part != count)) { | 487 | while (!(G.flags & FLAG_COUNT) || (G.in_full + G.in_part != count)) { |
480 | ssize_t n; | 488 | ssize_t n; |
489 | |||
481 | #if ENABLE_FEATURE_DD_IBS_OBS | 490 | #if ENABLE_FEATURE_DD_IBS_OBS |
482 | if (G.flags & FLAG_FULLBLOCK) | 491 | if (G.flags & FLAG_FULLBLOCK) |
483 | n = full_read(ifd, ibuf, ibs); | 492 | n = full_read(ifd, ibuf, ibs); |
@@ -559,6 +568,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
559 | if (write_and_stats(obuf, oc, obs, outfile)) | 568 | if (write_and_stats(obuf, oc, obs, outfile)) |
560 | goto out_status; | 569 | goto out_status; |
561 | } | 570 | } |
571 | |||
562 | if (close(ifd) < 0) { | 572 | if (close(ifd) < 0) { |
563 | die_infile: | 573 | die_infile: |
564 | bb_simple_perror_msg_and_die(infile); | 574 | bb_simple_perror_msg_and_die(infile); |
diff --git a/coreutils/du.c b/coreutils/du.c index d5ce46cf2..a0c99040e 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -133,7 +133,7 @@ static void print(unsigned long long size, const char *filename) | |||
133 | size++; | 133 | size++; |
134 | size >>= 1; | 134 | size >>= 1; |
135 | } | 135 | } |
136 | printf("%llu\t%s\n", size, filename); | 136 | printf("%"LL_FMT"u\t%s\n", size, filename); |
137 | #endif | 137 | #endif |
138 | } | 138 | } |
139 | 139 | ||
diff --git a/coreutils/expr.c b/coreutils/expr.c index e54afbb62..00bcf60d4 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -84,7 +84,7 @@ | |||
84 | #if ENABLE_EXPR_MATH_SUPPORT_64 | 84 | #if ENABLE_EXPR_MATH_SUPPORT_64 |
85 | typedef int64_t arith_t; | 85 | typedef int64_t arith_t; |
86 | 86 | ||
87 | #define PF_REZ "ll" | 87 | #define PF_REZ LL_FMT |
88 | #define PF_REZ_TYPE (long long) | 88 | #define PF_REZ_TYPE (long long) |
89 | #define STRTOL(s, e, b) strtoll(s, e, b) | 89 | #define STRTOL(s, e, b) strtoll(s, e, b) |
90 | #else | 90 | #else |
diff --git a/coreutils/factor.c b/coreutils/factor.c index 467e23a4d..ee3943a4a 100644 --- a/coreutils/factor.c +++ b/coreutils/factor.c | |||
@@ -161,7 +161,7 @@ static NOINLINE void factorize(wide_t N) | |||
161 | } | 161 | } |
162 | end: | 162 | end: |
163 | if (N > 1) | 163 | if (N > 1) |
164 | printf(" %llu", N); | 164 | printf(" %"LL_FMT"u", N); |
165 | bb_putchar('\n'); | 165 | bb_putchar('\n'); |
166 | } | 166 | } |
167 | 167 | ||
@@ -175,7 +175,7 @@ static void factorize_numstr(const char *numstr) | |||
175 | N = bb_strtoull(numstr, NULL, 10); | 175 | N = bb_strtoull(numstr, NULL, 10); |
176 | if (errno) | 176 | if (errno) |
177 | bb_show_usage(); | 177 | bb_show_usage(); |
178 | printf("%llu:", N); | 178 | printf("%"LL_FMT"u:", N); |
179 | factorize(N); | 179 | factorize(N); |
180 | } | 180 | } |
181 | 181 | ||
diff --git a/coreutils/ls.c b/coreutils/ls.c index db3ddb944..fb4f998be 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -492,12 +492,14 @@ static NOINLINE unsigned display_single(const struct dnode *dn) | |||
492 | /* Do readlink early, so that if it fails, error message | 492 | /* Do readlink early, so that if it fails, error message |
493 | * does not appear *inside* the "ls -l" line */ | 493 | * does not appear *inside* the "ls -l" line */ |
494 | lpath = NULL; | 494 | lpath = NULL; |
495 | #if !ENABLE_PLATFORM_MINGW32 | ||
495 | if (opt & OPT_l) | 496 | if (opt & OPT_l) |
496 | if (S_ISLNK(dn->dn_mode)) | 497 | if (S_ISLNK(dn->dn_mode)) |
497 | lpath = xmalloc_readlink_or_warn(dn->fullname); | 498 | lpath = xmalloc_readlink_or_warn(dn->fullname); |
499 | #endif | ||
498 | 500 | ||
499 | if (opt & OPT_i) /* show inode# */ | 501 | if (opt & OPT_i) /* show inode# */ |
500 | column += printf("%7llu ", (long long) dn->dn_ino); | 502 | column += printf("%7"LL_FMT"u ", (long long) dn->dn_ino); |
501 | //TODO: -h should affect -s too: | 503 | //TODO: -h should affect -s too: |
502 | if (opt & OPT_s) /* show allocated blocks */ | 504 | if (opt & OPT_s) /* show allocated blocks */ |
503 | column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); | 505 | column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); |
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 4cae0c529..75e14ef7d 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
@@ -101,6 +101,13 @@ typedef long long llong; | |||
101 | # define LDBL_DIG DBL_DIG | 101 | # define LDBL_DIG DBL_DIG |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #if ENABLE_PLATFORM_MINGW32 | ||
105 | /* symbol conflict */ | ||
106 | #define CHAR SIZE_CHAR | ||
107 | #define SHORT SIZE_SHORT | ||
108 | #define LONG SIZE_LONG | ||
109 | #define INT SIZE_INT | ||
110 | #endif | ||
104 | enum size_spec { | 111 | enum size_spec { |
105 | NO_SIZE, | 112 | NO_SIZE, |
106 | CHAR, | 113 | CHAR, |
diff --git a/coreutils/shred.c b/coreutils/shred.c index 3ceb58d19..0ebbc39ca 100644 --- a/coreutils/shred.c +++ b/coreutils/shred.c | |||
@@ -38,6 +38,10 @@ | |||
38 | 38 | ||
39 | #include "libbb.h" | 39 | #include "libbb.h" |
40 | 40 | ||
41 | #if ENABLE_PLATFORM_MINGW32 | ||
42 | #define xopen mingw_xopen | ||
43 | #endif | ||
44 | |||
41 | int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 45 | int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
42 | int shred_main(int argc UNUSED_PARAM, char **argv) | 46 | int shred_main(int argc UNUSED_PARAM, char **argv) |
43 | { | 47 | { |
@@ -96,8 +100,14 @@ int shred_main(int argc UNUSED_PARAM, char **argv) | |||
96 | } | 100 | } |
97 | if (opt & OPT_u) { | 101 | if (opt & OPT_u) { |
98 | ftruncate(fd, 0); | 102 | ftruncate(fd, 0); |
103 | #if ENABLE_PLATFORM_MINGW32 | ||
104 | xclose(fd); | ||
105 | #endif | ||
99 | xunlink(fname); | 106 | xunlink(fname); |
100 | } | 107 | } |
108 | #if ENABLE_PLATFORM_MINGW32 | ||
109 | else | ||
110 | #endif | ||
101 | xclose(fd); | 111 | xclose(fd); |
102 | } | 112 | } |
103 | } | 113 | } |
diff --git a/coreutils/stat.c b/coreutils/stat.c index 3d527ae63..43fad2324 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
@@ -31,7 +31,6 @@ | |||
31 | //config: bool "Enable display of filesystem status (-f)" | 31 | //config: bool "Enable display of filesystem status (-f)" |
32 | //config: default y | 32 | //config: default y |
33 | //config: depends on STAT | 33 | //config: depends on STAT |
34 | //config: select PLATFORM_LINUX # statfs() | ||
35 | //config: help | 34 | //config: help |
36 | //config: Without this, stat will not support the '-f' option to display | 35 | //config: Without this, stat will not support the '-f' option to display |
37 | //config: information about filesystem status. | 36 | //config: information about filesystem status. |
@@ -318,6 +317,7 @@ static void FAST_FUNC print_stat(char *pformat, const char m, | |||
318 | printfs(pformat, filename); | 317 | printfs(pformat, filename); |
319 | } else if (m == 'N') { | 318 | } else if (m == 'N') { |
320 | strcatc(pformat, 's'); | 319 | strcatc(pformat, 's'); |
320 | #if !ENABLE_PLATFORM_MINGW32 | ||
321 | if (S_ISLNK(statbuf->st_mode)) { | 321 | if (S_ISLNK(statbuf->st_mode)) { |
322 | char *linkname = xmalloc_readlink_or_warn(filename); | 322 | char *linkname = xmalloc_readlink_or_warn(filename); |
323 | if (linkname == NULL) | 323 | if (linkname == NULL) |
@@ -327,6 +327,9 @@ static void FAST_FUNC print_stat(char *pformat, const char m, | |||
327 | } else { | 327 | } else { |
328 | printf(pformat, filename); | 328 | printf(pformat, filename); |
329 | } | 329 | } |
330 | #else | ||
331 | printf(pformat, filename); | ||
332 | #endif | ||
330 | } else if (m == 'd') { | 333 | } else if (m == 'd') { |
331 | strcat(pformat, "llu"); | 334 | strcat(pformat, "llu"); |
332 | printf(pformat, (unsigned long long) statbuf->st_dev); | 335 | printf(pformat, (unsigned long long) statbuf->st_dev); |
@@ -709,6 +712,7 @@ static bool do_stat(const char *filename, const char *format) | |||
709 | gw_ent = getgrgid(statbuf.st_gid); | 712 | gw_ent = getgrgid(statbuf.st_gid); |
710 | pw_ent = getpwuid(statbuf.st_uid); | 713 | pw_ent = getpwuid(statbuf.st_uid); |
711 | 714 | ||
715 | #if !ENABLE_PLATFORM_MINGW32 | ||
712 | if (S_ISLNK(statbuf.st_mode)) | 716 | if (S_ISLNK(statbuf.st_mode)) |
713 | linkname = xmalloc_readlink_or_warn(filename); | 717 | linkname = xmalloc_readlink_or_warn(filename); |
714 | if (linkname) { | 718 | if (linkname) { |
@@ -717,6 +721,9 @@ static bool do_stat(const char *filename, const char *format) | |||
717 | } else { | 721 | } else { |
718 | printf(" File: '%s'\n", filename); | 722 | printf(" File: '%s'\n", filename); |
719 | } | 723 | } |
724 | #else | ||
725 | printf(" File: '%s'\n", filename); | ||
726 | #endif | ||
720 | 727 | ||
721 | printf(" Size: %-10llu\tBlocks: %-10llu IO Block: %-6lu %s\n" | 728 | printf(" Size: %-10llu\tBlocks: %-10llu IO Block: %-6lu %s\n" |
722 | "Device: %llxh/%llud\tInode: %-10llu Links: %-5lu", | 729 | "Device: %llxh/%llud\tInode: %-10llu Links: %-5lu", |
diff --git a/coreutils/sum.c b/coreutils/sum.c index 487e93f4a..ee758877f 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c | |||
@@ -82,9 +82,9 @@ static unsigned sum_file(const char *file, unsigned type) | |||
82 | if (type >= SUM_SYSV) { | 82 | if (type >= SUM_SYSV) { |
83 | r = (s & 0xffff) + ((s & 0xffffffff) >> 16); | 83 | r = (s & 0xffff) + ((s & 0xffffffff) >> 16); |
84 | s = (r & 0xffff) + (r >> 16); | 84 | s = (r & 0xffff) + (r >> 16); |
85 | printf("%u %llu %s\n", s, (total_bytes + 511) / 512, file); | 85 | printf("%u %"LL_FMT"u %s\n", s, (total_bytes + 511) / 512, file); |
86 | } else | 86 | } else |
87 | printf("%05u %5llu %s\n", s, (total_bytes + 1023) / 1024, file); | 87 | printf("%05u %5"OFF_FMT"u %s\n", s, (total_bytes + 1023) / 1024, file); |
88 | return 1; | 88 | return 1; |
89 | #undef buf | 89 | #undef buf |
90 | } | 90 | } |
diff --git a/coreutils/tee.c b/coreutils/tee.c index f0ec791bb..d0ded58c4 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
@@ -69,9 +69,11 @@ int tee_main(int argc, char **argv) | |||
69 | signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. (why?) */ | 69 | signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. (why?) */ |
70 | } | 70 | } |
71 | retval = EXIT_SUCCESS; | 71 | retval = EXIT_SUCCESS; |
72 | #ifdef SIGPIPE | ||
72 | /* gnu tee ignores SIGPIPE in case one of the output files is a pipe | 73 | /* gnu tee ignores SIGPIPE in case one of the output files is a pipe |
73 | * that doesn't consume all its input. Good idea... */ | 74 | * that doesn't consume all its input. Good idea... */ |
74 | signal(SIGPIPE, SIG_IGN); | 75 | signal(SIGPIPE, SIG_IGN); |
76 | #endif | ||
75 | 77 | ||
76 | /* Allocate an array of FILE *'s, with one extra for a sentinel. */ | 78 | /* Allocate an array of FILE *'s, with one extra for a sentinel. */ |
77 | fp = files = xzalloc(sizeof(FILE *) * (argc + 2)); | 79 | fp = files = xzalloc(sizeof(FILE *) * (argc + 2)); |
diff --git a/coreutils/timeout.c b/coreutils/timeout.c index e42aba85c..3b2140807 100644 --- a/coreutils/timeout.c +++ b/coreutils/timeout.c | |||
@@ -46,11 +46,27 @@ | |||
46 | 46 | ||
47 | #include "libbb.h" | 47 | #include "libbb.h" |
48 | 48 | ||
49 | #if ENABLE_PLATFORM_MINGW32 | ||
50 | HANDLE child = INVALID_HANDLE_VALUE; | ||
51 | |||
52 | static void kill_child(void) | ||
53 | { | ||
54 | if (child != INVALID_HANDLE_VALUE) { | ||
55 | kill_SIGTERM_by_handle(child, 128+SIGTERM); | ||
56 | } | ||
57 | } | ||
58 | #endif | ||
59 | |||
49 | int timeout_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 60 | int timeout_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
50 | int timeout_main(int argc UNUSED_PARAM, char **argv) | 61 | int timeout_main(int argc UNUSED_PARAM, char **argv) |
51 | { | 62 | { |
52 | int signo; | 63 | int signo; |
64 | #if !ENABLE_PLATFORM_MINGW32 | ||
53 | int status; | 65 | int status; |
66 | #else | ||
67 | intptr_t ret; | ||
68 | DWORD status = EXIT_SUCCESS; | ||
69 | #endif | ||
54 | int parent = 0; | 70 | int parent = 0; |
55 | int timeout; | 71 | int timeout; |
56 | pid_t pid; | 72 | pid_t pid; |
@@ -59,6 +75,10 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
59 | #endif | 75 | #endif |
60 | const char *opt_s = "TERM"; | 76 | const char *opt_s = "TERM"; |
61 | 77 | ||
78 | #if ENABLE_PLATFORM_MINGW32 | ||
79 | xfunc_error_retval = 125; | ||
80 | #endif | ||
81 | |||
62 | /* -p option is not documented, it is needed to support NOMMU. */ | 82 | /* -p option is not documented, it is needed to support NOMMU. */ |
63 | 83 | ||
64 | /* -t SECONDS; -p PARENT_PID */ | 84 | /* -t SECONDS; -p PARENT_PID */ |
@@ -67,7 +87,11 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
67 | /*argv += optind; - no, wait for bb_daemonize_or_rexec! */ | 87 | /*argv += optind; - no, wait for bb_daemonize_or_rexec! */ |
68 | 88 | ||
69 | signo = get_signum(opt_s); | 89 | signo = get_signum(opt_s); |
90 | #if !ENABLE_PLATFORM_MINGW32 | ||
70 | if (signo < 0) | 91 | if (signo < 0) |
92 | #else | ||
93 | if (signo != SIGTERM && signo != SIGKILL && signo != 0) | ||
94 | #endif | ||
71 | bb_error_msg_and_die("unknown signal '%s'", opt_s); | 95 | bb_error_msg_and_die("unknown signal '%s'", opt_s); |
72 | 96 | ||
73 | if (!argv[optind]) | 97 | if (!argv[optind]) |
@@ -76,6 +100,7 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
76 | if (!argv[optind]) /* no PROG? */ | 100 | if (!argv[optind]) /* no PROG? */ |
77 | bb_show_usage(); | 101 | bb_show_usage(); |
78 | 102 | ||
103 | #if !ENABLE_PLATFORM_MINGW32 | ||
79 | /* We want to create a grandchild which will watch | 104 | /* We want to create a grandchild which will watch |
80 | * and kill the grandparent. Other methods: | 105 | * and kill the grandparent. Other methods: |
81 | * making parent watch child disrupts parent<->child link | 106 | * making parent watch child disrupts parent<->child link |
@@ -129,4 +154,32 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
129 | argv[1] = sv2; | 154 | argv[1] = sv2; |
130 | #endif | 155 | #endif |
131 | BB_EXECVP_or_die(argv); | 156 | BB_EXECVP_or_die(argv); |
157 | #else /* ENABLE_PLATFORM_MINGW32 */ | ||
158 | if ((ret=mingw_spawn_proc((const char **)argv)) == -1) { | ||
159 | xfunc_error_retval = errno == EACCES ? 126 : 127; | ||
160 | bb_perror_msg_and_die("can't execute '%s'", argv[0]); | ||
161 | } | ||
162 | |||
163 | child = (HANDLE)ret; | ||
164 | atexit(kill_child); | ||
165 | while (1) { | ||
166 | sleep(1); | ||
167 | if (signo && --timeout <= 0) { | ||
168 | status = signo == SIGKILL ? 137 : 124; | ||
169 | break; | ||
170 | } | ||
171 | if (WaitForSingleObject(child, 0) == WAIT_OBJECT_0) { | ||
172 | /* process is gone */ | ||
173 | GetExitCodeProcess(child, &status); | ||
174 | goto finish; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | pid = (pid_t)GetProcessId(child); | ||
179 | kill(pid, signo); | ||
180 | finish: | ||
181 | CloseHandle(child); | ||
182 | child = INVALID_HANDLE_VALUE; | ||
183 | return status; | ||
184 | #endif | ||
132 | } | 185 | } |
diff --git a/coreutils/yes.c b/coreutils/yes.c index c244bfe10..6dc47355e 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c | |||
@@ -41,6 +41,10 @@ int yes_main(int argc UNUSED_PARAM, char **argv) | |||
41 | ++argv; | 41 | ++argv; |
42 | 42 | ||
43 | do { | 43 | do { |
44 | #if ENABLE_PLATFORM_MINGW32 | ||
45 | if (ferror(stdout) != 0) | ||
46 | break; | ||
47 | #endif | ||
44 | pp = argv; | 48 | pp = argv; |
45 | while (1) { | 49 | while (1) { |
46 | fputs(*pp, stdout); | 50 | fputs(*pp, stdout); |