dd: code shrink
function old new delta write_and_stats 78 99 +21 dd_main 1496 1487 -9 full_write_or_warn 42 - -42 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 21/-51) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
90e9cfd218
commit
f3114a3bd0
@ -440,8 +440,10 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
oc = 0;
|
oc = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (write_and_stats(ibuf, n, obs, outfile))
|
} else {
|
||||||
goto out_status;
|
if (write_and_stats(ibuf, n, obs, outfile))
|
||||||
|
goto out_status;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & FLAG_FSYNC) {
|
if (flags & FLAG_FSYNC) {
|
||||||
if (fsync(ofd) < 0)
|
if (fsync(ofd) < 0)
|
||||||
@ -450,9 +452,8 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ENABLE_FEATURE_DD_IBS_OBS && oc) {
|
if (ENABLE_FEATURE_DD_IBS_OBS && oc) {
|
||||||
ssize_t w = full_write_or_warn(obuf, oc, outfile);
|
if (write_and_stats(obuf, oc, obs, outfile))
|
||||||
if (w < 0) goto out_status;
|
goto out_status;
|
||||||
if (w > 0) G.out_part++;
|
|
||||||
}
|
}
|
||||||
if (close(ifd) < 0) {
|
if (close(ifd) < 0) {
|
||||||
die_infile:
|
die_infile:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user