Revision 27e3ddd3

b/monitor.c
1324 1324
        if (l > size)
1325 1325
            l = size;
1326 1326
        cpu_memory_rw_debug(env, addr, buf, l, 0);
1327
        fwrite(buf, 1, l, f);
1327
        if (fwrite(buf, 1, l, f) != l) {
1328
            monitor_printf(mon, "fwrite() error in do_memory_save\n");
1329
            goto exit;
1330
        }
1328 1331
        addr += l;
1329 1332
        size -= l;
1330 1333
    }
1334
exit:
1331 1335
    fclose(f);
1332 1336
}
1333 1337

  
......
1351 1355
        if (l > size)
1352 1356
            l = size;
1353 1357
        cpu_physical_memory_rw(addr, buf, l, 0);
1354
        fwrite(buf, 1, l, f);
1358
        if (fwrite(buf, 1, l, f) != l) {
1359
            monitor_printf(mon, "fwrite() error in do_physical_memory_save\n");
1360
            goto exit;
1361
        }
1355 1362
        fflush(f);
1356 1363
        addr += l;
1357 1364
        size -= l;
1358 1365
    }
1366
exit:
1359 1367
    fclose(f);
1360 1368
}
1361 1369

  

Also available in: Unified diff