summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-kmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udev-builtin-kmod.c')
-rw-r--r--src/udev/udev-builtin-kmod.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c
index a9704c101c..57e2a9af7f 100644
--- a/src/udev/udev-builtin-kmod.c
+++ b/src/udev/udev-builtin-kmod.c
@@ -67,8 +67,21 @@ static int load_module(struct udev *udev, const char *alias)
kmod_module_unref_list(list);
return err;
#else
- char *const argv[] = { MODPROBE, "-bq", alias, 0 };
- return execute_command(MODPROBE, argv);
+ int retval;
+
+ /*
+ These 3 temporaries are needed because argv (below) is a const pointer, not pointer to const
+ */
+ char *tmp_alias = strdup(alias);
+ char *tmp_modprobe = strdup(MODPROBE);
+ char *tmp_bq = strdup("-bq");
+ char *const argv[] = { tmp_modprobe, tmp_bq, tmp_alias, 0 };
+
+ retval = execute_command(MODPROBE, argv);
+
+ free(tmp_alias);
+ free(tmp_modprobe);
+ free(tmp_bq);
#endif
}