Signed-off-by: Jamey Sharp <[EMAIL PROTECTED]>
---
A "shouldn't happen" case that I triggered due to a different bug in
Windows. I thought that, in the unlikely event that this case occurs, an
infinite loop is a rather harsh result.

 kexec/kexec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 3a1656a..f898428 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -408,6 +408,8 @@ char *slurp_file(const char *filename, off_t *r_size)
                        die("read on %s of %ld bytes failed: %s\n", filename,
                            (size - progress)+ 0UL, strerror(errno));
                }
+               if (result == 0)
+                       die("read on %s ended before stat said it should\n", 
filename);
                progress += result;
        }
        result = close(fd);
-- 
1.5.4.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to