dd: call fsync() only once before exiting if conv=fsync is specified
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
a98db793cf
commit
dba0dc1999
@ -532,11 +532,11 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (write_and_stats(ibuf, n, obs, outfile))
|
||||
goto out_status;
|
||||
}
|
||||
}
|
||||
|
||||
if (G.flags & FLAG_FSYNC) {
|
||||
if (fsync(ofd) < 0)
|
||||
goto die_outfile;
|
||||
}
|
||||
if (G.flags & FLAG_FSYNC) {
|
||||
if (fsync(ofd) < 0)
|
||||
goto die_outfile;
|
||||
}
|
||||
|
||||
if (ENABLE_FEATURE_DD_IBS_OBS && oc) {
|
||||
|
Loading…
Reference in New Issue
Block a user