Commit 6bcb76c3b62195820daed29d621cda3fbe4256f3
1 parent
e4a89056
vvfat fixes (Roger Lathrop)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2152 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
2 deletions
block-vvfat.c
... | ... | @@ -61,7 +61,7 @@ void nonono(const char* file, int line, const char* msg) { |
61 | 61 | exit(-5); |
62 | 62 | } |
63 | 63 | #undef assert |
64 | -#define assert(a) if (!(a)) nonono(__FILE__, __LINE__, #a) | |
64 | +#define assert(a) do {if (!(a)) nonono(__FILE__, __LINE__, #a);}while(0) | |
65 | 65 | #endif |
66 | 66 | |
67 | 67 | #else |
... | ... | @@ -2174,7 +2174,7 @@ static int commit_one_file(BDRVVVFATState* s, |
2174 | 2174 | for (i = s->cluster_size; i < offset; i += s->cluster_size) |
2175 | 2175 | c = modified_fat_get(s, c); |
2176 | 2176 | |
2177 | - fd = open(mapping->path, O_RDWR | O_CREAT, 0666); | |
2177 | + fd = open(mapping->path, O_RDWR | O_CREAT | O_BINARY, 0666); | |
2178 | 2178 | if (fd < 0) { |
2179 | 2179 | fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path, |
2180 | 2180 | strerror(errno), errno); | ... | ... |