summaryrefslogtreecommitdiff
path: root/namedev.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 /namedev.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 'namedev.c')
-rw-r--r--namedev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/namedev.c b/namedev.c
index d63e36e18a..268a3d5be6 100644
--- a/namedev.c
+++ b/namedev.c
@@ -358,7 +358,7 @@ static void fix_kernel_name(struct udevice *udev)
}
}
-static int execute_program(const char *path, char *value, int len)
+static int execute_program(struct udevice *udev, const char *path, char *value, int len)
{
int retval;
int count;
@@ -391,7 +391,7 @@ static int execute_program(const char *path, char *value, int len)
dbg("execute '%s' with parsed arguments", arg);
} else {
argv[0] = arg;
- argv[1] = main_argv[1];
+ argv[1] = udev->subsystem;
argv[2] = NULL;
dbg("execute '%s' with subsystem '%s' argument", arg, argv[1]);
}
@@ -655,7 +655,7 @@ static int match_rule(struct config_device *dev, struct sysfs_class_device *clas
dbg("check " FIELD_PROGRAM);
strfieldcpy(program, dev->program);
apply_format(udev, program, sizeof(program), class_dev, sysfs_device);
- if (execute_program(program, udev->program_result, NAME_SIZE) != 0) {
+ if (execute_program(udev, program, udev->program_result, NAME_SIZE) != 0) {
dbg(FIELD_PROGRAM " returned nonzero");
goto try_parent;
} else {