]> xenbits.xensource.com Git - people/dstodden/blktap.git/commitdiff
vhd-stream: flush after write
authorJake Wires <Jake.Wires@citrix.com>
Wed, 1 Sep 2010 21:12:45 +0000 (14:12 -0700)
committerDaniel Stodden <daniel.stodden@citrix.com>
Tue, 30 Aug 2011 12:52:01 +0000 (13:52 +0100)
vhd/lib/libvhd-stream.c

index 13734d2c6af97041e62b765e94b02e8109b8248f..e279f45a8abdf558a91480abe6faa9d8fca1d2bd 100644 (file)
@@ -99,7 +99,8 @@ vhd_stream_write(struct vhd_stream *vstream, const void *buf, size_t count)
                goto out;
        }
 
-       if (fwrite(buf, count, 1, vstream->stream) == 1) {
+       if (fwrite(buf, count, 1, vstream->stream) == 1 &&
+           !fflush(vstream->stream)) {
                err = 0;
                vstream->pos += count;
        } else {