summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-04-16 23:58:05 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:15 -0700
commit7d855c3116ec9ddab9adde96b568681930d9855b (patch)
tree31794ef4fc3d2c198b0451f972280d5120bdb2f9 /udevd.c
parentaf5b5178fa9cb8b75d00fb364f266c3919f12cd2 (diff)
[PATCH] udevd test script
Thanks to Yin, Hu <hu.yin@intel.com>, who made a nice perl script to test the expected behavior of the udevd sequence number handling. The test sends different SEQNUM sequences to udevd, while analyzing the reordering and timeout handling of udevd.
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);