summaryrefslogtreecommitdiff
path: root/udevstart.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-12 06:20:22 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:24:38 -0700
commitaf4b05d4917fdfa55eff3d8d53a830464d8162a1 (patch)
tree352f8b4180c9be6f848c7f69517783b7912c42d3 /udevstart.c
parent13f24d596c5638443ffc7bc48c10a66758335c74 (diff)
[PATCH] make the udev object available to more processing stages
Remove the overwriting of main_argv[] hack and use the values from the udev object. Pass the udev object to call_foreach_file(). In the udevstart case, export SUBSYSTEM and UDEVSTART to the environment.
Diffstat (limited to 'udevstart.c')
-rw-r--r--udevstart.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/udevstart.c b/udevstart.c
index e05680aa93..0433e568d4 100644
--- a/udevstart.c
+++ b/udevstart.c
@@ -92,16 +92,10 @@ static int add_device(char *devpath, char *subsystem)
struct udevice udev;
char path[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev;
- char *argv[3];
- /* fake argument vector and environment for callouts and dev.d/ */
- argv[0] = "udev";
- argv[1] = subsystem;
- argv[2] = NULL;
-
- main_argv = argv;
+ /* set environment for callouts and dev.d/ */
setenv("DEVPATH", devpath, 1);
- setenv("ACTION", "add", 1);
+ setenv("SUBSYSTEM", subsystem, 1);
snprintf(path, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
class_dev = sysfs_open_class_device_path(path);
@@ -291,7 +285,12 @@ static void udev_scan_class(void)
int udev_start(void)
{
+ /* set environment for callouts and dev.d/ */
+ setenv("ACTION", "add", 1);
+ setenv("UDEVSTART", "1", 1);
+
udev_scan_class();
udev_scan_block();
+
return 0;
}