+Mon Feb 23 13:19:58 1998 Michael Meissner <meissner@cygnus.com>
+
+ * syscall.c (cb_syscall): Handle short reads, and EOF.
+
Tue Feb 24 00:29:57 1998 Andrew Cagney <cagney@b1.cygnus.com>
* sim-trace.c (print_data): case trace_fmt_fp missing break. Use
? count : FILE_XFR_SIZE));
if (result == -1)
goto ErrorFinish;
+ if (result == 0) /* EOF */
+ break;
bytes_written = (*sc->write_mem) (cb, sc, addr, buf, result);
if (bytes_written != result)
{
bytes_read += result;
count -= result;
addr += result;
+ /* If this is a short read, don't go back for more */
+ if (result != FILE_XFR_SIZE)
+ break;
}
result = bytes_read;
}
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
- if (fd == 2)
+ else if (fd == 2)
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);