Commit 27e3ddd3 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Anthony Liguori
Browse files

monitor.c: fix warnings with _FORTIFY_SOURCE



CC    i386-softmmu/monitor.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1318: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_physical_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
make[1]: *** [monitor.o] Error 1

Signed-off-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent dc330e28
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1324,10 +1324,14 @@ static void do_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data)
        if (l > size)
            l = size;
        cpu_memory_rw_debug(env, addr, buf, l, 0);
        fwrite(buf, 1, l, f);
        if (fwrite(buf, 1, l, f) != l) {
            monitor_printf(mon, "fwrite() error in do_memory_save\n");
            goto exit;
        }
        addr += l;
        size -= l;
    }
exit:
    fclose(f);
}

@@ -1351,11 +1355,15 @@ static void do_physical_memory_save(Monitor *mon, const QDict *qdict,
        if (l > size)
            l = size;
        cpu_physical_memory_rw(addr, buf, l, 0);
        fwrite(buf, 1, l, f);
        if (fwrite(buf, 1, l, f) != l) {
            monitor_printf(mon, "fwrite() error in do_physical_memory_save\n");
            goto exit;
        }
        fflush(f);
        addr += l;
        size -= l;
    }
exit:
    fclose(f);
}