===================================================================
@@ -787,14 +787,21 @@ int main(int argc, char *argv[])
{
const char *arch = qtest_get_arch();
FILE *f = fopen(disk, "w");
+ size_t s;
+ int err;
int ret;
if (!f) {
fprintf(stderr, "Couldn't open \"%s\": %s", disk, strerror(errno));
return 1;
}
- fwrite(boot_sector, 1, sizeof boot_sector, f);
+ s = fwrite(boot_sector, 1, sizeof boot_sector, f);
+ err = errno;
fclose(f);
+ if (s != sizeof boot_sector) {
+ fprintf(stderr, "Couldn't write \"%s\": %s", disk, strerror(err));
+ return 1;
+ }
g_test_init(&argc, &argv, NULL);
Fix: .../tests/bios-tables-test.c: In function 'main': .../tests/bios-tables-test.c:796:11: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make: *** [tests/bios-tables-test.o] Error 1 happening when building QEMU with the `--enable-werror' configuration option present. Report any failure from `fwrite'. Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> --- qemu-test-bios-tables-fwrite.diff