From: Theodore Ts'o Date: Tue, 23 Apr 2024 05:00:56 +0000 (-0400) Subject: mke2fs: use the correct shared library version for libarchive on FreeBSD X-Git-Tag: v1.47.1-rc1~35 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=8c012b7b572175c116e69756e4a03c553787ed3f;p=tools%2Fe2fsprogs.git mke2fs: use the correct shared library version for libarchive on FreeBSD Adjust for the fact that Linux uses libarchive.so.13, while freeBSD uses libarchive.so.7. Signed-off-by: Theodore Ts'o --- diff --git a/misc/create_inode_libarchive.c b/misc/create_inode_libarchive.c index 97b82d2..4d561fe 100644 --- a/misc/create_inode_libarchive.c +++ b/misc/create_inode_libarchive.c @@ -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;