[git commit master 1/1] seq: exit on write errors
Denys Vlasenko
vda.linux at googlemail.com
Sun Oct 17 10:44:39 UTC 2010
commit: http://git.busybox.net/busybox/commit/?id=786635e62e4c8a8646d01ede1c7bb98ce604c7fa
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
coreutils/seq.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/coreutils/seq.c b/coreutils/seq.c
index 8be2536..22bf3ec 100644
--- a/coreutils/seq.c
+++ b/coreutils/seq.c
@@ -86,7 +86,8 @@ int seq_main(int argc, char **argv)
v = first;
n = 0;
while (increment >= 0 ? v <= last : v >= last) {
- printf("%s%0*.*f", sep, width, frac_part, v);
+ if (printf("%s%0*.*f", sep, width, frac_part, v) < 0)
+ break; /* I/O error, bail out (yes, this really happens) */
sep = opt_s;
/* v += increment; - would accumulate floating point errors */
n++;
--
1.7.1
More information about the busybox-cvs
mailing list