This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos 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: [ECOS] fis load -d


OK, here is the patch.  After further investigation, I learned that the size
information was being passed to the decompression function properly.  For
whatever reason, when 'gzip_close()' got a result of 'Z_OK', it decided that
if it produced any output, then an error occured.  This simple patch works
around that without disturbing too much else.  The correct fix would
probably be to have 'gzip_inflate()' return 'Z_STREAM_END' normally.  I
can't imagine any reason why it behaves the way that it does (i.e. testing
to see if any bytes were output and returning 'Z_OK' if they were), but
that's the way it works.  My change works around that.

'nuff said.

--wpd
Index: packages/redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.85
diff -c -r1.85 ChangeLog
*** packages/redboot/current/ChangeLog	18 Dec 2002 13:03:16 -0000	1.85
--- packages/redboot/current/ChangeLog	31 Dec 2002 21:52:09 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2002-12-31  Patrick Doyle  <wpd@delcomsys.com>
+
+ 	* src/decompress.c (gzip_close): Don't complain that decompression
+ 	didn't complete when the stream reaches its end.
+
  2002-12-18  David Mazur  <david@mind.be>
  2002-12-18  Mark Salter  <msalter@redhat.com>

Index: packages/redboot/current/src/decompress.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/decompress.c,v
retrieving revision 1.7
diff -c -r1.7 decompress.c
*** packages/redboot/current/src/decompress.c	13 Sep 2002 21:33:26 -0000	1.7
--- packages/redboot/current/src/decompress.c	31 Dec 2002 21:52:10 -0000
***************
*** 313,318 ****
--- 313,321 ----
          err = 0;
          break;
      case Z_OK:
+         if (stream_end) {
+           break;
+         }
          // Decompression didn't complete
          p->msg = "premature end of input";
          // fall-through


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