summaryrefslogtreecommitdiff
path: root/namedev_parse.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-12-03 01:08:46 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:05 -0700
commite8bacccab296d6b75c4c9f43cb4e71007aff5b8a (patch)
treead65d8917550ec7e8addf84816e16452fd722986 /namedev_parse.c
parent29b82deb7e8d7634792bd50be1377bae170a8acb (diff)
[PATCH] add support for a main udev config file, udev.conf.
the older udev.config file is now called udev.rules. This allows us to better control configuration values, and move away from the environment variables.
Diffstat (limited to 'namedev_parse.c')
-rw-r--r--namedev_parse.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/namedev_parse.c b/namedev_parse.c
index a752b33050..bd23867e18 100644
--- a/namedev_parse.c
+++ b/namedev_parse.c
@@ -36,7 +36,7 @@
#include "udev.h"
#include "namedev.h"
-static int get_pair(char **orig_string, char **left, char **right)
+int get_pair(char **orig_string, char **left, char **right)
{
char *temp;
char *string = *orig_string;
@@ -137,7 +137,7 @@ void dump_config_dev_list(void)
}
}
-int namedev_init_config(void)
+int namedev_init_rules(void)
{
char line[255];
int lineno;
@@ -148,10 +148,11 @@ int namedev_init_config(void)
int retval = 0;
struct config_device dev;
- dbg("opening '%s' to read as config", udev_config_filename);
- fd = fopen(udev_config_filename, "r");
- if (fd == NULL) {
- dbg("can't open '%s'", udev_config_filename);
+ fd = fopen(udev_rules_filename, "r");
+ if (fd != NULL) {
+ dbg("reading '%s' as rules file", udev_rules_filename);
+ } else {
+ dbg("can't open '%s' as a rules file", udev_rules_filename);
return -ENODEV;
}
@@ -328,7 +329,7 @@ int namedev_init_config(void)
goto exit;
}
}
- dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
+ dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_rules_filename,
lineno, temp - line, temp);
exit:
fclose(fd);
@@ -345,10 +346,11 @@ int namedev_init_permissions(void)
int retval = 0;
struct config_device dev;
- dbg("opening '%s' to read as permissions config", udev_config_permission_filename);
- fd = fopen(udev_config_permission_filename, "r");
- if (fd == NULL) {
- dbg("can't open '%s'", udev_config_permission_filename);
+ fd = fopen(udev_permission_filename, "r");
+ if (fd != NULL) {
+ dbg("reading '%s' as permissions file", udev_permission_filename);
+ } else {
+ dbg("can't open '%s' as permissions file", udev_permission_filename);
return -ENODEV;
}