Skip to content

Commit

Permalink
mke2fs: use the correct shared library version for libarchive on FreeBSD
Browse files Browse the repository at this point in the history
Adjust for the fact that Linux uses libarchive.so.13, while freeBSD
uses libarchive.so.7.

Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
tytso committed Apr 23, 2024
1 parent ea562cb commit 8c012b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion misc/create_inode_libarchive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8c012b7

Please sign in to comment.