summaryrefslogtreecommitdiff
path: root/udev/udev-builtin-kmod.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-23 02:02:44 +0100
committerKay Sievers <kay.sievers@vrfy.org>2011-12-23 02:02:44 +0100
commite216e514cf0c3bc6352f43fa3a7ffad221200bca (patch)
tree0ebb4007064451265fc2a4b58ac7f82c6eb7011e /udev/udev-builtin-kmod.c
parentdb634679ad58b3205910c969ac5359b1d6f625ad (diff)
build argv[] for builtin commands
Diffstat (limited to 'udev/udev-builtin-kmod.c')
-rw-r--r--udev/udev-builtin-kmod.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/udev/udev-builtin-kmod.c b/udev/udev-builtin-kmod.c
index 90f9c564ed..4e8ec653fe 100644
--- a/udev/udev-builtin-kmod.c
+++ b/udev/udev-builtin-kmod.c
@@ -30,23 +30,30 @@
static char *kmod;
-static int builtin_kmod(struct udev_device *dev, const char *command, bool test)
+static int builtin_kmod(struct udev_device *dev, int argc, char *argv[], bool test)
{
- printf("soon we load a module here: '%s'\n", command);
+ struct udev *udev = udev_device_get_udev(dev);
+
+ if (argc < 3) {
+ err(udev, "missing command + argument\n");
+ return EXIT_FAILURE;
+ }
+
+ printf("soon we '%s' the module '%s' (%i) here\n", argv[1], argv[2], argc);
printf("test: %s\n", kmod);
return EXIT_SUCCESS;
}
static int builtin_kmod_load(struct udev *udev)
{
- printf("load module index\n");
- asprintf(&kmod, "pid: %u\n", getpid());
+ info(udev, "load module index\n");
+ asprintf(&kmod, "pid: %u", getpid());
return 0;
}
static int builtin_kmod_unload(struct udev *udev)
{
- printf("unload module index\n");
+ info(udev, "unload module index\n");
free(kmod);
return 0;
}