This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/cache.c] large fread fails on NetApp share...


Hi Joel,

2008-04-29 Joel Brobecker <brobecker@adacore.com>

        * cache.c (cache_bread_1): Renames cache_bread.
        (cache_bread): New function.

A reasonable idea, but I think that there is a bug:


+      chunk_nread = cache_bread_1 (abfd, buf + nread, chunk_size);
+      nread += chunk_nread;
+
+      if (chunk_nread < chunk_size)
+        break;
+    }
+
+  return nread;

If cache_bread_1() returns -1 for a read after the first chunk then cache_bread() will return one less byte than was actually read. Hardly world shattering I agree, but it would nice to see this corner case handled correctly.


Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]