teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0385-Drop-support-for-lz4-1.3.0.patch

4cad4c
From 09c96d5ef3f2b0bc4e5f1cf69e9b66248e325509 Mon Sep 17 00:00:00 2001
4cad4c
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
4cad4c
Date: Mon, 29 Oct 2018 18:32:51 +0100
4cad4c
Subject: [PATCH] Drop support for lz4 < 1.3.0
4cad4c
4cad4c
lz4-r130 was released on May 29th, 2015. Let's drop the work-around for older
4cad4c
versions. In particular, we won't test any new code against those ancient
4cad4c
releases, so we shouldn't pretend they are supported.
4cad4c
4cad4c
(cherry picked from commit e0a1d4b049e6991919a0eacd5d96f7f39dc6ddd1)
4cad4c
Resolves: #1843871
4cad4c
---
4cad4c
 README                      | 2 +-
4cad4c
 meson.build                 | 1 +
4cad4c
 src/journal/compress.c      | 4 ----
4cad4c
 src/journal/test-compress.c | 4 ----
4cad4c
 4 files changed, 2 insertions(+), 9 deletions(-)
4cad4c
4cad4c
diff --git a/README b/README
4cad4c
index 7d06e04800..859152fbde 100644
4cad4c
--- a/README
4cad4c
+++ b/README
4cad4c
@@ -148,7 +148,7 @@ REQUIREMENTS:
4cad4c
         libacl (optional)
4cad4c
         libselinux (optional)
4cad4c
         liblzma (optional)
4cad4c
-        liblz4 >= 119 (optional)
4cad4c
+        liblz4 >= 1.3.0 / 130 (optional)
4cad4c
         libgcrypt (optional)
4cad4c
         libqrencode (optional)
4cad4c
         libmicrohttpd (optional)
4cad4c
diff --git a/meson.build b/meson.build
4cad4c
index 70811c29cf..c8ae1e15bd 100644
4cad4c
--- a/meson.build
4cad4c
+++ b/meson.build
4cad4c
@@ -1076,6 +1076,7 @@ conf.set10('HAVE_XZ', have)
4cad4c
 want_lz4 = get_option('lz4')
4cad4c
 if want_lz4 != 'false' and not fuzzer_build
4cad4c
         liblz4 = dependency('liblz4',
4cad4c
+                            version : '>= 1.3.0',
4cad4c
                             required : want_lz4 == 'true')
4cad4c
         have = liblz4.found()
4cad4c
 else
4cad4c
diff --git a/src/journal/compress.c b/src/journal/compress.c
4cad4c
index 6baf15c8ff..a4a5e63840 100644
4cad4c
--- a/src/journal/compress.c
4cad4c
+++ b/src/journal/compress.c
4cad4c
@@ -95,11 +95,7 @@ int compress_blob_lz4(const void *src, uint64_t src_size,
4cad4c
         if (src_size < 9)
4cad4c
                 return -ENOBUFS;
4cad4c
 
4cad4c
-#if LZ4_VERSION_NUMBER >= 10700
4cad4c
         r = LZ4_compress_default(src, (char*)dst + 8, src_size, (int) dst_alloc_size - 8);
4cad4c
-#else
4cad4c
-        r = LZ4_compress_limitedOutput(src, (char*)dst + 8, src_size, (int) dst_alloc_size - 8);
4cad4c
-#endif
4cad4c
         if (r <= 0)
4cad4c
                 return -ENOBUFS;
4cad4c
 
4cad4c
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
4cad4c
index 791c6fdffb..eb3dc3eb6b 100644
4cad4c
--- a/src/journal/test-compress.c
4cad4c
+++ b/src/journal/test-compress.c
4cad4c
@@ -207,11 +207,7 @@ static void test_lz4_decompress_partial(void) {
4cad4c
         memset(huge, 'x', HUGE_SIZE);
4cad4c
         memcpy(huge, "HUGE=", 5);
4cad4c
 
4cad4c
-#if LZ4_VERSION_NUMBER >= 10700
4cad4c
         r = LZ4_compress_default(huge, buf, HUGE_SIZE, buf_size);
4cad4c
-#else
4cad4c
-        r = LZ4_compress_limitedOutput(huge, buf, HUGE_SIZE, buf_size);
4cad4c
-#endif
4cad4c
         assert_se(r >= 0);
4cad4c
         compressed = r;
4cad4c
         log_info("Compressed %i → %zu", HUGE_SIZE, compressed);