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:
5afd63a
)
dd: fixed partial count logic
author
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 10 Jan 2018 10:04:09 +0000
(11:04 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 10 Jan 2018 10:04:09 +0000
(11:04 +0100)
$ busybox dd if=/dev/zero of=/dev/loop0 bs=100M count=8; echo $?
8+0 records in
7+0 records out <=========== FIXED, was 7+1
805220352
bytes (767.9MB) copied, 0.464010 seconds, 1.6GB/s
1
function old new delta
write_and_stats 97 99 +2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/dd.c
patch
|
blob
|
history
diff --git
a/coreutils/dd.c
b/coreutils/dd.c
index 9d173cc13b03caf706066fcb85444cfb1890f81d..38b2a6aa14ddf36e6eb2caf105a52c2b185113dc 100644
(file)
--- a/
coreutils/dd.c
+++ b/
coreutils/dd.c
@@
-202,8
+202,10
@@
static bool write_and_stats(const void *buf, size_t len, size_t obs,
G.out_full++;
return 0;
}
- if (
n) /* > 0 */
+ if (
(size_t)n == len) {
G.out_part++;
+ return 0;
+ }
return 1;
}