summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/udevd.c b/udevd.c
index b2cb62f386..d807e4168d 100644
--- a/udevd.c
+++ b/udevd.c
@@ -60,6 +60,7 @@ static void exec_queue_manager(void);
static void msg_queue_manager(void);
static void user_sighandler(void);
static void reap_kids(void);
+char *udev_bin;
#ifdef LOG
unsigned char logname[LOGNAME_SIZE];
@@ -146,7 +147,7 @@ static void udev_run(struct hotplug_msg *msg)
switch (pid) {
case 0:
/* child */
- execle(UDEV_BIN, "udev", msg->subsystem, NULL, env);
+ execle(udev_bin, "udev", msg->subsystem, NULL, env);
dbg("exec of child failed");
exit(1);
break;
@@ -458,6 +459,13 @@ int main(int argc, char *argv[])
/* enable receiving of the sender credentials */
setsockopt(ssock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
+ /* possible override of udev binary, used for testing */
+ udev_bin = getenv("UDEV_BIN");
+ if (udev_bin != NULL)
+ dbg("udev binary is set to '%s'", udev_bin);
+ else
+ udev_bin = UDEV_BIN;
+
FD_ZERO(&readfds);
FD_SET(ssock, &readfds);
FD_SET(pipefds[0], &readfds);