]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
mke2fs: use the correct shared library version for libarchive on FreeBSD
authorTheodore Ts'o <tytso@mit.edu>
Tue, 23 Apr 2024 05:00:56 +0000 (01:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 23 Apr 2024 05:00:56 +0000 (01:00 -0400)
Adjust for the fact that Linux uses libarchive.so.13, while freeBSD
uses libarchive.so.7.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/create_inode_libarchive.c

index 97b82d232fe593e455244076594c5bced6018d63..4d561fed56023d51611fb40aa8cbb3e45246acf1 100644 (file)
@@ -55,10 +55,16 @@ static int (*dl_archive_read_support_format_all)(struct archive *);
 
 static void *libarchive_handle;
 
+#if defined(__FreeBSD__)
+#define LIBARCHIVE_SO "libarchive.so.7"
+#else
+#define LIBARCHIVE_SO "libarchive.so.13"
+#endif
+
 static int libarchive_available(void)
 {
        if (!libarchive_handle) {
-               libarchive_handle = dlopen("libarchive.so.13", RTLD_NOW);
+               libarchive_handle = dlopen(LIBARCHIVE_SO, RTLD_NOW);
                if (!libarchive_handle)
                        return 0;