]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: do not fail if dlopen of libmount fails because it is not compiled in
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 5 Dec 2025 11:58:34 +0000 (11:58 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 5 Dec 2025 16:36:43 +0000 (01:36 +0900)
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.

src/core/main.c

index f4acdb02c6c24f2f9d9b94e2c964835eecea6794..cab8e0094118e3e598e5cf1d53b1dc88d16cd1b0 100644 (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;
         }