diff options
author | Marc Laukien <marc@zeroc.com> | 2002-04-17 00:45:41 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-04-17 00:45:41 +0000 |
commit | 750036eb43f5a60fc8cdf31c5cee2f31c7051080 (patch) | |
tree | 10ee86852d3d7e28121687334a5b1b4938c405c8 /cpp/src/IcePatch/Util.cpp | |
parent | Updates to provide better ConfigParser error reporting in exceptions, and (diff) | |
download | ice-750036eb43f5a60fc8cdf31c5cee2f31c7051080.tar.bz2 ice-750036eb43f5a60fc8cdf31c5cee2f31c7051080.tar.xz ice-750036eb43f5a60fc8cdf31c5cee2f31c7051080.zip |
Fixes
Diffstat (limited to 'cpp/src/IcePatch/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 4146a2b8345..3ee1afc17c2 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -598,7 +598,6 @@ IcePatch::getRegular(const RegularPrx& regular, ProgressCB& progressCB) Byte bytes[num]; progressCB.startUncompress(totalBZ2); - int countBZ2 = 0; while (bzError != BZ_STREAM_END) { @@ -618,8 +617,17 @@ IcePatch::getRegular(const RegularPrx& regular, ProgressCB& progressCB) if (sz > 0) { - countBZ2 += sz; - progressCB.updateUncompress(totalBZ2, countBZ2); + long pos = ftell(stdioFileBZ2); + if (pos == -1) + { + FileAccessException ex; + ex.reason = "cannot get read position for `" + pathBZ2 + "': " + strerror(errno); + BZ2_bzReadClose(&bzError, bzFile); + fclose(stdioFileBZ2); + throw ex; + } + + progressCB.updateUncompress(totalBZ2, pos); file.write(bytes, sz); if (!file) |