From: David ‘Bombe’ Roden Date: Sat, 26 Jun 2010 11:20:34 +0000 (+0200) Subject: Sync after every write. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=df9c1b25a21fcba03ecaf448aa285ad61a162078;p=ccp.git Sync after every write. --- diff --git a/ccp.c b/ccp.c index 6a40186..a83d2e8 100644 --- 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;