summaryrefslogtreecommitdiff
path: root/udev/udev-builtin-kmod.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-25 18:59:42 +0100
committerKay Sievers <kay.sievers@vrfy.org>2011-12-25 18:59:42 +0100
commit80df994cc22eb7f98187df9bc2281c7fd7b96af7 (patch)
tree4a585fa2f6f720afd436f1b9e7bf8024bb1cd618 /udev/udev-builtin-kmod.c
parent85eaf38c3b2fd70a8b01b72bbdb936c0a5944b3c (diff)
builtin: kmod - hook up udev main logging to libkmod
Diffstat (limited to 'udev/udev-builtin-kmod.c')
-rw-r--r--udev/udev-builtin-kmod.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/udev/udev-builtin-kmod.c b/udev/udev-builtin-kmod.c
index e6c4d95109..f5b41b1ab4 100644
--- a/udev/udev-builtin-kmod.c
+++ b/udev/udev-builtin-kmod.c
@@ -316,6 +316,12 @@ static int insmod(struct kmod_ctx *ctx, const char *name, const char *extra_opti
return insmod_alias(ctx, name, extra_options);
}
+static void udev_kmod_log(void *data, int priority, const char *file, int line,
+ const char *fn, const char *format, va_list args)
+{
+ udev_main_log(data, priority, file, line, fn, format, args);
+}
+
static int builtin_kmod(struct udev_device *dev, int argc, char *argv[], bool test)
{
struct udev *udev = udev_device_get_udev(dev);
@@ -327,6 +333,7 @@ static int builtin_kmod(struct udev_device *dev, int argc, char *argv[], bool te
return -ENOMEM;
info(udev, "load module index\n");
+ kmod_set_log_fn(ctx, udev_kmod_log, udev);
kmod_load_resources(ctx);
}
@@ -353,6 +360,7 @@ static int builtin_kmod_init(struct udev *udev)
return -ENOMEM;
info(udev, "load module index\n");
+ kmod_set_log_fn(ctx, udev_kmod_log, udev);
kmod_load_resources(ctx);
return 0;
}