Flush bitmap file before truncate.

Otheriwse the last write happens on fclose which is after ftruncate,
to the truncate has no effect.
This commit is contained in:
Neil Brown 2006-10-16 14:39:06 +10:00
parent 0a816ef9fb
commit 97a6748ce2
1 changed files with 1 additions and 0 deletions

View File

@ -390,6 +390,7 @@ int CreateBitmap(char *filename, int force, char uuid[16],
}
rv = 0;
fflush(fp);
/* make the file be the right size (well, to the nearest byte) */
if (ftruncate(fileno(fp), filesize))
perror("ftrunace");