chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
machinectl: fix handling of --verify= argument for dkr downloads
[elogind.git]
/
src
/
journal
/
compress.c
diff --git
a/src/journal/compress.c
b/src/journal/compress.c
index 52a4c100b338fd9d08936f742eb4427d97c68bd6..6923753f894a0aac25755e5dedf6d478d70fa041 100644
(file)
--- a/
src/journal/compress.c
+++ b/
src/journal/compress.c
@@
-356,7
+356,7
@@
int compress_stream_xz(int fdf, int fdt, off_t max_bytes) {
ret = lzma_easy_encoder(&s, LZMA_PRESET_DEFAULT, LZMA_CHECK_CRC64);
if (ret != LZMA_OK) {
ret = lzma_easy_encoder(&s, LZMA_PRESET_DEFAULT, LZMA_CHECK_CRC64);
if (ret != LZMA_OK) {
- log_error("Failed to initialize XZ encoder: code %
d
", ret);
+ log_error("Failed to initialize XZ encoder: code %
u
", ret);
return -EINVAL;
}
return -EINVAL;
}
@@
-391,7
+391,7
@@
int compress_stream_xz(int fdf, int fdt, off_t max_bytes) {
ret = lzma_code(&s, action);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
ret = lzma_code(&s, action);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
- log_error("Compression failed: code %
d
", ret);
+ log_error("Compression failed: code %
u
", ret);
return -EBADMSG;
}
return -EBADMSG;
}
@@
-400,12
+400,9
@@
int compress_stream_xz(int fdf, int fdt, off_t max_bytes) {
n = sizeof(out) - s.avail_out;
n = sizeof(out) - s.avail_out;
- errno = 0;
k = loop_write(fdt, out, n, false);
if (k < 0)
return k;
k = loop_write(fdt, out, n, false);
if (k < 0)
return k;
- if (k != n)
- return errno ? -errno : -EIO;
if (ret == LZMA_STREAM_END) {
log_debug("XZ compression finished (%"PRIu64" -> %"PRIu64" bytes, %.1f%%)",
if (ret == LZMA_STREAM_END) {
log_debug("XZ compression finished (%"PRIu64" -> %"PRIu64" bytes, %.1f%%)",
@@
-460,10
+457,10
@@
int compress_stream_lz4(int fdf, int fdt, off_t max_bytes) {
total_in += n;
total_in += n;
- r = LZ4_compress_
limitedOutput_continue(&lz4_data, buf, out, n
, n);
+ r = LZ4_compress_
continue(&lz4_data, buf, out
, n);
if (r == 0) {
if (r == 0) {
- log_
debug("Compressed size exceeds original, aborting compression
.");
- return -E
NOBUFS
;
+ log_
error("LZ4 compression failed
.");
+ return -E
BADMSG
;
}
header = htole32(r);
}
header = htole32(r);
@@
-478,8
+475,6
@@
int compress_stream_lz4(int fdf, int fdt, off_t max_bytes) {
n = loop_write(fdt, out, r, false);
if (n < 0)
return n;
n = loop_write(fdt, out, r, false);
if (n < 0)
return n;
- if (n != r)
- return errno ? -errno : -EIO;
total_out += sizeof(header) + r;
total_out += sizeof(header) + r;
@@
-517,7
+512,7
@@
int decompress_stream_xz(int fdf, int fdt, off_t max_bytes) {
ret = lzma_stream_decoder(&s, UINT64_MAX, 0);
if (ret != LZMA_OK) {
ret = lzma_stream_decoder(&s, UINT64_MAX, 0);
if (ret != LZMA_OK) {
- log_error("Failed to initialize XZ decoder: code %
d
", ret);
+ log_error("Failed to initialize XZ decoder: code %
u
", ret);
return -ENOMEM;
}
return -ENOMEM;
}
@@
-543,7
+538,7
@@
int decompress_stream_xz(int fdf, int fdt, off_t max_bytes) {
ret = lzma_code(&s, action);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
ret = lzma_code(&s, action);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
- log_error("Decompression failed: code %
d
", ret);
+ log_error("Decompression failed: code %
u
", ret);
return -EBADMSG;
}
return -EBADMSG;
}
@@
-559,12
+554,9
@@
int decompress_stream_xz(int fdf, int fdt, off_t max_bytes) {
max_bytes -= n;
}
max_bytes -= n;
}
- errno = 0;
k = loop_write(fdt, out, n, false);
if (k < 0)
return k;
k = loop_write(fdt, out, n, false);
if (k < 0)
return k;
- if (k != n)
- return errno ? -errno : -EIO;
if (ret == LZMA_STREAM_END) {
log_debug("XZ decompression finished (%"PRIu64" -> %"PRIu64" bytes, %.1f%%)",
if (ret == LZMA_STREAM_END) {
log_debug("XZ decompression finished (%"PRIu64" -> %"PRIu64" bytes, %.1f%%)",
@@
-645,12
+637,9
@@
int decompress_stream_lz4(int fdf, int fdt, off_t max_bytes) {
return -EFBIG;
}
return -EFBIG;
}
- errno = 0;
n = loop_write(fdt, out, r, false);
if (n < 0)
return n;
n = loop_write(fdt, out, r, false);
if (n < 0)
return n;
- if (n != r)
- return errno ? -errno : -EIO;
}
log_debug("LZ4 decompression finished (%zu -> %zu bytes, %.1f%%)",
}
log_debug("LZ4 decompression finished (%zu -> %zu bytes, %.1f%%)",