From aef6bb132ef2f5b4c446e42f6050033d4f5c177b Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Fri, 23 Apr 2004 21:50:27 -0700 Subject: [PATCH] udev default config layout changes Here we catch up, after the default config changes. o the man page is updated to reflect the new default config o /etc/udev/rules.d/ + permissions.d/ dirs are created now o udev.rules is installed in /etc/udev/rules.d/50-udev.rules so the user can easily order the files by prepending a number. (RedHat has the same name in the last rpm.) o defined directory names in the Makefile are all without slashes now, not the first half with and the remaining without. o all binaries are uninstalled now o leading slashes in config values are now removed or prepended while the config is parsed, so we are more robust if the usere changes something. o replaced the macros from udev_config.c with real code, cause we can skip if the value matches and not useless iterate over the remaining fields. o config parsing errors are logged with info() now, fixes the bug where we report a error with debug_parse(), even when there isn't one --- udev_lib.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'udev_lib.c') diff --git a/udev_lib.c b/udev_lib.c index 381492db01..16b473f576 100644 --- a/udev_lib.c +++ b/udev_lib.c @@ -152,6 +152,26 @@ size_t buf_get_line(char *buf, size_t buflen, size_t cur) return count - cur; } +void leading_slash(char *path) +{ + int len; + + len = strlen(path); + if (len > 0 && path[len-1] != '/') { + path[len] = '/'; + path[len+1] = '\0'; + } +} + +void no_leading_slash(char *path) +{ + int len; + + len = strlen(path); + if (len > 0 && path[len-1] == '/') + path[len-1] = '\0'; +} + struct files { struct list_head list; char name[NAME_SIZE]; @@ -180,7 +200,7 @@ static int file_list_insert(char *filename, struct list_head *file_list) return 0; } -/* calls function for file or every file found in directory */ +/* calls function for every file found in specified directory */ int call_foreach_file(int fnct(char *f) , char *dirname, char *suffix) { struct dirent *ent; -- cgit v1.2.3-54-g00ecf