Subversion Repositories spk

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 211
Line 74... Line 74...
74
        /* write out current buffer contents if full, or if flushing, but if
74
        /* write out current buffer contents if full, or if flushing, but if
75
           doing Z_FINISH then don't write until we get to Z_STREAM_END */
75
           doing Z_FINISH then don't write until we get to Z_STREAM_END */
76
        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
76
        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
77
            (flush != Z_FINISH || ret == Z_STREAM_END))) {
77
            (flush != Z_FINISH || ret == Z_STREAM_END))) {
78
            have = (unsigned)(strm->next_out - state->next);
78
            have = (unsigned)(strm->next_out - state->next);
79
            if (have && ((got = write(state->fd, state->next, have)) < 0 ||
79
            if (have && ((got = _write(state->fd, state->next, have)) < 0 ||
80
                         (unsigned)got != have)) {
80
                         (unsigned)got != have)) {
81
                gz_error(state, Z_ERRNO, zstrerror());
81
                gz_error(state, Z_ERRNO, zstrerror());
82
                return -1;
82
                return -1;
83
            }
83
            }
84
            if (strm->avail_out == 0) {
84
            if (strm->avail_out == 0) {
Line 523... Line 523...
523
    (void)deflateEnd(&(state->strm));
523
    (void)deflateEnd(&(state->strm));
524
    free(state->out);
524
    free(state->out);
525
    free(state->in);
525
    free(state->in);
526
    gz_error(state, Z_OK, NULL);
526
    gz_error(state, Z_OK, NULL);
527
    free(state->path);
527
    free(state->path);
528
    ret += close(state->fd);
528
    ret += _close(state->fd);
529
    free(state);
529
    free(state);
530
    return ret ? Z_ERRNO : Z_OK;
530
    return ret ? Z_ERRNO : Z_OK;
531
}
531
}