]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
compress: do something roughly reasonable when building without compressor
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Jun 2020 14:35:10 +0000 (16:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Jun 2020 13:03:18 +0000 (15:03 +0200)
src/journal/compress.h

index 042d6e66873f444f8e40471901005a0fa3736867..ab44ff06ede87fee8a568d27610813e17d94d44f 100644 (file)
@@ -26,10 +26,12 @@ static inline int compress_blob(const void *src, uint64_t src_size,
         r = compress_blob_lz4(src, src_size, dst, dst_alloc_size, dst_size);
         if (r == 0)
                 return OBJECT_COMPRESSED_LZ4;
-#else
+#elif HAVE_XZ
         r = compress_blob_xz(src, src_size, dst, dst_alloc_size, dst_size);
         if (r == 0)
                 return OBJECT_COMPRESSED_XZ;
+#else
+        r = -EOPNOTSUPP;
 #endif
         return r;
 }
@@ -76,9 +78,14 @@ int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size);
 #elif HAVE_LZ4
 #  define compress_stream compress_stream_lz4
 #  define COMPRESSED_EXT ".lz4"
-#else
+#elif HAVE_XZ
 #  define compress_stream compress_stream_xz
 #  define COMPRESSED_EXT ".xz"
+#else
+static inline int compress_stream(int fdf, int fdt, uint64_t max_size) {
+        return -EOPNOTSUPP;
+}
+#  define COMPRESSED_EXT ""
 #endif
 
 int decompress_stream(const char *filename, int fdf, int fdt, uint64_t max_bytes);