projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad8def2
)
seq: exit on write errors
author
Denys Vlasenko
<vda.linux@googlemail.com>
Sun, 17 Oct 2010 10:44:39 +0000
(12:44 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Sun, 17 Oct 2010 10:44:39 +0000
(12:44 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/seq.c
patch
|
blob
|
history
diff --git
a/coreutils/seq.c
b/coreutils/seq.c
index 8be25360ffd21a2c9a510dd426d648d04d74b872..22bf3ec9de141c7b7e1e7ac77d2bd9c45059af4b 100644
(file)
--- 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++;