version 1.22, 2004/09/06 21:24:11 |
version 1.23, 2005/06/26 18:20:26 |
|
|
if (s->z_mode == 'w') { |
if (s->z_mode == 'w') { |
/* write the .gz header */ |
/* write the .gz header */ |
if (put_header(s, name, mtime, bits) != 0) { |
if (put_header(s, name, mtime, bits) != 0) { |
gz_close(s, NULL); |
gz_close(s, NULL, NULL, NULL); |
s = NULL; |
s = NULL; |
} |
} |
} else { |
} else { |
/* read the .gz header */ |
/* read the .gz header */ |
if (get_header(s, name, gotmagic) != 0) { |
if (get_header(s, name, gotmagic) != 0) { |
gz_close(s, NULL); |
gz_close(s, NULL, NULL, NULL); |
s = NULL; |
s = NULL; |
} |
} |
} |
} |
|
|
} |
} |
|
|
int |
int |
gz_close(void *cookie, struct z_info *info) |
gz_close(void *cookie, struct z_info *info, const char *name, struct stat *sb) |
{ |
{ |
gz_stream *s = (gz_stream*)cookie; |
gz_stream *s = (gz_stream*)cookie; |
int err = 0; |
int err = 0; |
|
|
info->total_out = (off_t)s->z_stream.total_out; |
info->total_out = (off_t)s->z_stream.total_out; |
} |
} |
|
|
|
setfile(name, s->z_fd, sb); |
if (!err) |
if (!err) |
err = close(s->z_fd); |
err = close(s->z_fd); |
else |
else |