diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index 6fd984dfa99..48b54b45dea 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,8 @@ +2021-05-06 Mike Frysinger + + * emulos.c: Include errno.h & stdio.h. + (emul_write): Print a warning when the write fails. + 2021-05-04 Mike Frysinger * dv-m68hc11.c (struct m68hc11cpu): Change attach_size to unsigned int. diff --git a/sim/m68hc11/emulos.c b/sim/m68hc11/emulos.c index 916364f306c..247e66871cf 100644 --- a/sim/m68hc11/emulos.c +++ b/sim/m68hc11/emulos.c @@ -23,6 +23,8 @@ along with this program. If not, see . */ #endif #ifndef WIN32 +#include +#include #include #include @@ -103,8 +105,9 @@ emul_write (sim_cpu *cpu) while (size) { uint8 val = memory_read8 (cpu, addr); - - write(0, &val, 1); + + if (write (0, &val, 1) != 1) + printf ("write failed: %s\n", strerror (errno)); addr ++; size--; }