~ubuntu-branches/ubuntu/quantal/libarchive/quantal

« back to all changes in this revision

Viewing changes to libarchive/archive_write_set_compression_xz.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2011-09-18 10:25:34 UTC
  • mfrom: (8.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110918102534-kmke53ir9v21ooxu
Tags: 2.8.5-3
* Fix upgrade breakage because of manpages being moved from libarchive1 to
  libarchive-dev. (Closes: #641978)
* Make short descriptions for packages unique.
* Explicitly set config options to be used during builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
archive_compressor_xz_init_stream(struct archive_write *a,
133
133
    struct private_data *state)
134
134
{
 
135
        static const lzma_stream lzma_stream_init_data = LZMA_STREAM_INIT;
135
136
        int ret;
136
137
 
137
 
        state->stream = (lzma_stream)LZMA_STREAM_INIT;
 
138
        state->stream = lzma_stream_init_data;
138
139
        state->stream.next_out = state->compressed;
139
140
        state->stream.avail_out = state->compressed_buffer_size;
140
141
        if (a->archive.compression_code == ARCHIVE_COMPRESSION_XZ)
421
422
                        archive_set_error(&a->archive, ENOMEM,
422
423
                            "lzma compression error: "
423
424
                            "%ju MiB would have been needed",
424
 
                            (lzma_memusage(&(state->stream)) + 1024 * 1024 -1)
425
 
                            / (1024 * 1024));
 
425
                            (uintmax_t)((lzma_memusage(&(state->stream)) + 1024 * 1024 -1)
 
426
                                / (1024 * 1024)));
426
427
                        return (ARCHIVE_FATAL);
427
428
                default:
428
429
                        /* Any other return value indicates an error. */