Don't loose last block during a dma.
authorAndrew Cagney <cagney@redhat.com>
Thu, 10 May 2001 17:48:10 +0000 (17:48 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 10 May 2001 17:48:10 +0000 (17:48 +0000)
sim/ppc/ChangeLog
sim/ppc/hw_init.c

index 8fee13a4d9af1393d16ef53b2089bf202398c33c..2b9e6669a57b832f8107c5bd44df5a92293f6ac2 100644 (file)
@@ -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
index b486f6f78601f7978ec8fd8af6566a19e604fbf8..86e753c608ae78588f820c52f651d8809d043283 100644 (file)
@@ -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,