Sync after every write.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 26 Jun 2010 11:20:34 +0000 (13:20 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 26 Jun 2010 11:20:34 +0000 (13:20 +0200)
ccp.c

diff --git a/ccp.c b/ccp.c
index 6a40186..a83d2e8 100644 (file)
--- a/ccp.c
+++ b/ccp.c
@@ -149,6 +149,7 @@ int copyFileToFile(char* sourceFile, char* destFile) {
                                }
                                toWrite -= written;
                        } while (toWrite);
+                       fsync(fileno(outputFile));
                        ftime(&endTime);
                        writtenTotal += written;
                        progress = (double) writtenTotal / fileSize;