pid1: do not fail if dlopen of libmount fails because it is not compiled in

It is now possible to build and run without libmount. But if support
is compiled in, then we need to be able to load it. Hence gracefully
skip it when support is not compiled in, but fail otherwise.
This commit is contained in:
Luca Boccassi
2025-12-05 11:58:34 +00:00
committed by Yu Watanabe
parent 64ba571576
commit fdb9ad1a44

View File

@@ -3311,8 +3311,9 @@ int main(int argc, char *argv[]) {
goto finish;
}
/* Building without libmount is allowed, but if it is compiled in, then we must be able to load it */
r = dlopen_libmount();
if (r < 0) {
if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r)) {
error_message = "Failed to load libmount.so";
goto finish;
}