summaryrefslogtreecommitdiff
path: root/udev_lib.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-04-23 21:50:27 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:17 -0700
commitaef6bb132ef2f5b4c446e42f6050033d4f5c177b (patch)
tree1ab956b49274969379cd70a435646d8a2e013a59 /udev_lib.c
parentda361dd7dfd451153e9dc10866a79de8a9f2f414 (diff)
[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
Diffstat (limited to 'udev_lib.c')
-rw-r--r--udev_lib.c22
1 files changed, 21 insertions, 1 deletions
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;