diff options
| author | Rostislav Skudnov <rostislav@tuxera.com> | 2017-03-16 20:54:35 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-03-16 20:54:35 +0100 |
| commit | dba0dc1999bb1e8bfe64607e2a9385cda361fcb7 (patch) | |
| tree | bd849a66f4f84dc258c6f6fb93e68db71107f04c | |
| parent | a98db793cffb77a8794c854443b8fe12bad98c0a (diff) | |
| download | busybox-w32-dba0dc1999bb1e8bfe64607e2a9385cda361fcb7.tar.gz busybox-w32-dba0dc1999bb1e8bfe64607e2a9385cda361fcb7.tar.bz2 busybox-w32-dba0dc1999bb1e8bfe64607e2a9385cda361fcb7.zip | |
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>
| -rw-r--r-- | coreutils/dd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 5e68087fc..7d980f1c4 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
| @@ -532,11 +532,11 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
| 532 | if (write_and_stats(ibuf, n, obs, outfile)) | 532 | if (write_and_stats(ibuf, n, obs, outfile)) |
| 533 | goto out_status; | 533 | goto out_status; |
| 534 | } | 534 | } |
| 535 | } | ||
| 535 | 536 | ||
| 536 | if (G.flags & FLAG_FSYNC) { | 537 | if (G.flags & FLAG_FSYNC) { |
| 537 | if (fsync(ofd) < 0) | 538 | if (fsync(ofd) < 0) |
| 538 | goto die_outfile; | 539 | goto die_outfile; |
| 539 | } | ||
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | if (ENABLE_FEATURE_DD_IBS_OBS && oc) { | 542 | if (ENABLE_FEATURE_DD_IBS_OBS && oc) { |
