]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-file.c
target-ppc: Altivec 2.07: Vector Doubleword Rotate and Shift Instructions
[mirror_qemu.git] / qemu-file.c
index 9473b674ba517b2b78820ff269a0713809952cca..f074af15c31bde289076713de9b84dd5ae202713 100644 (file)
@@ -100,7 +100,14 @@ static int stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
                             int size)
 {
     QEMUFileStdio *s = opaque;
-    return fwrite(buf, 1, size, s->stdio_file);
+    int res;
+
+    res = fwrite(buf, 1, size, s->stdio_file);
+
+    if (res != size) {
+        return -EIO;   /* fake errno value */
+    }
+    return res;
 }
 
 static int stdio_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)