aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-09 12:03:20 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-09 12:03:20 +0000
commit6bcb76c3b62195820daed29d621cda3fbe4256f3 (patch)
tree2a3b33cd10fdfaa1f68d002cc683f02eb7bb5338 /block-vvfat.c
parentfix serial irq logic (Blue Swirl) (diff)
downloadqemu-kvm-6bcb76c3b62195820daed29d621cda3fbe4256f3.tar.gz
qemu-kvm-6bcb76c3b62195820daed29d621cda3fbe4256f3.tar.bz2
qemu-kvm-6bcb76c3b62195820daed29d621cda3fbe4256f3.zip
vvfat fixes (Roger Lathrop)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2152 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-vvfat.c')
-rw-r--r--block-vvfat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block-vvfat.c b/block-vvfat.c
index ad6b7d29e..48a52e311 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -61,7 +61,7 @@ void nonono(const char* file, int line, const char* msg) {
exit(-5);
}
#undef assert
-#define assert(a) if (!(a)) nonono(__FILE__, __LINE__, #a)
+#define assert(a) do {if (!(a)) nonono(__FILE__, __LINE__, #a);}while(0)
#endif
#else
@@ -2174,7 +2174,7 @@ static int commit_one_file(BDRVVVFATState* s,
for (i = s->cluster_size; i < offset; i += s->cluster_size)
c = modified_fat_get(s, c);
- fd = open(mapping->path, O_RDWR | O_CREAT, 0666);
+ fd = open(mapping->path, O_RDWR | O_CREAT | O_BINARY, 0666);
if (fd < 0) {
fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path,
strerror(errno), errno);