summaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-05-10 17:48:10 +0000
committerAndrew Cagney <cagney@redhat.com>2001-05-10 17:48:10 +0000
commitb491862d6db3fe363d552e55cdc384615af2ab78 (patch)
treed7738d5d0c70d3703b9b377f7895b019a63faff2 /sim/ppc
parent50850dcd7c087fa18784b568574e95debcca1cbf (diff)
downloadgdb-b491862d6db3fe363d552e55cdc384615af2ab78.tar.gz
Don't loose last block during a dma.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/ChangeLog5
-rw-r--r--sim/ppc/hw_init.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 8fee13a4d9a..2b9e6669a57 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 7 10:45:12 HST 2001 Glen Nakamura <gen@lava.net>
+
+ * hw_init.c (dma_file): Fixed problem with loading last 1KB of
+ file.
+
2001-03-04 Andrew Cagney <ac131313@redhat.com>
* emul_netbsd.c [WITH_NetBSD_HOST]: Include <sys/mount.h> and
diff --git a/sim/ppc/hw_init.c b/sim/ppc/hw_init.c
index b486f6f7860..86e753c608a 100644
--- a/sim/ppc/hw_init.c
+++ b/sim/ppc/hw_init.c
@@ -47,7 +47,7 @@ dma_file(device *me,
count = 0;
while (1) {
inc = fread(buf, 1, sizeof(buf), image);
- if (feof(image) || ferror(image))
+ if (inc <= 0)
break;
if (device_dma_write_buffer(device_parent(me),
buf,