From af4b05d4917fdfa55eff3d8d53a830464d8162a1 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Fri, 12 Nov 2004 06:20:22 +0100 Subject: [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. --- namedev_parse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'namedev_parse.c') diff --git a/namedev_parse.c b/namedev_parse.c index 22e3523f3d..73828a83b2 100644 --- a/namedev_parse.c +++ b/namedev_parse.c @@ -142,7 +142,7 @@ static char *get_key_attribute(char *str) return NULL; } -static int namedev_parse_rules(char *filename) +static int namedev_parse_rules(const char *filename, void *data) { char line[LINE_SIZE]; char *bufline; @@ -343,7 +343,7 @@ error: return retval; } -static int namedev_parse_permissions(char *filename) +static int namedev_parse_permissions(const char *filename, void *data) { char line[LINE_SIZE]; char *bufline; @@ -447,10 +447,10 @@ int namedev_init_rules(void) stat(udev_rules_filename, &stats); if ((stats.st_mode & S_IFMT) != S_IFDIR) - return namedev_parse_rules(udev_rules_filename); + return namedev_parse_rules(udev_rules_filename, NULL); else - return call_foreach_file(namedev_parse_rules, - udev_rules_filename, RULEFILE_SUFFIX); + return call_foreach_file(namedev_parse_rules, udev_rules_filename, + RULEFILE_SUFFIX, NULL); } int namedev_init_permissions(void) @@ -459,8 +459,8 @@ int namedev_init_permissions(void) stat(udev_permissions_filename, &stats); if ((stats.st_mode & S_IFMT) != S_IFDIR) - return namedev_parse_permissions(udev_permissions_filename); + return namedev_parse_permissions(udev_permissions_filename, NULL); else - return call_foreach_file(namedev_parse_permissions, - udev_permissions_filename, PERMFILE_SUFFIX); + return call_foreach_file(namedev_parse_permissions, udev_permissions_filename, + PERMFILE_SUFFIX, NULL); } -- cgit v1.2.3-54-g00ecf