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 <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2024-04-23 01:00:56 -04:00
parent ea562cbcd9
commit 8c012b7b57

View 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;