From 374546c2398cce814fdb904c807d3878df025c56 Mon Sep 17 00:00:00 2001 From: Ian Stakenvicius Date: Fri, 4 Jan 2013 16:17:39 -0500 Subject: Fix bugs in execv() calls to modprobe Change the execv() call to an execvp() call so that --with-modprobe="modprobe" is supported; also added the command as argv[0] in the call to execvp(), which fixes the failures when 'modprobe' is a symlink to kmod Signed off by ryao --- src/libudev/util.c | 2 +- src/udev/udev-builtin-kmod.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libudev/util.c b/src/libudev/util.c index d8c5bb2e1e..92fd22775b 100644 --- a/src/libudev/util.c +++ b/src/libudev/util.c @@ -4312,7 +4312,7 @@ int execute_command(const char *command, char *const argv[]) if (pid == 0) { - execv(command, argv); + execvp(command, argv); log_error("Failed to execute %s: %m", command); _exit(EXIT_FAILURE); diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c index 89c7ab0b77..300090a5b9 100644 --- a/src/udev/udev-builtin-kmod.c +++ b/src/udev/udev-builtin-kmod.c @@ -68,7 +68,7 @@ static int load_module(struct udev *udev, char *const alias) kmod_module_unref_list(list); return err; #else - char * const argv[] = { "-bq", alias, 0 }; + char * const argv[] = { MODPROBE, "-bq", alias, 0 }; return execute_command(MODPROBE, argv); #endif } -- cgit v1.2.3-54-g00ecf