]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udev-builtin-kmod.c
Merge pull request #15669 from andir/systemd-ipv6-pd-subnet-id
[thirdparty/systemd.git] / src / udev / udev-builtin-kmod.c
index 052c7aa31199796a72528e461072ddf25b35e57a..b3daddcdd5465c29ba2f04c2520b4b456c93f33e 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include <errno.h>
-#include <libkmod.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,15 +26,14 @@ static int builtin_kmod(sd_device *dev, int argc, char *argv[], bool test) {
         if (!ctx)
                 return 0;
 
-        if (argc < 3 || !streq(argv[1], "load")) {
-                log_error("%s: expected: load <module>", argv[0]);
-                return EXIT_FAILURE;
-        }
+        if (argc < 3 || !streq(argv[1], "load"))
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "%s: expected: load <module>", argv[0]);
 
         for (i = 2; argv[i]; i++)
                 (void) module_load_and_warn(ctx, argv[i], false);
 
-        return EXIT_SUCCESS;
+        return 0;
 }
 
 /* called at udev startup and reload */
@@ -67,7 +65,7 @@ static bool builtin_kmod_validate(void) {
         return (kmod_validate_resources(ctx) != KMOD_RESOURCES_OK);
 }
 
-const struct udev_builtin udev_builtin_kmod = {
+const UdevBuiltin udev_builtin_kmod = {
         .name = "kmod",
         .cmd = builtin_kmod,
         .init = builtin_kmod_init,