chiark / gitweb /
rename apply_format() cause it is public now
authorKay Sievers <kay.sievers@suse.de>
Wed, 25 Jan 2006 00:28:31 +0000 (01:28 +0100)
committerKay Sievers <kay.sievers@suse.de>
Wed, 25 Jan 2006 00:28:31 +0000 (01:28 +0100)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
udev.c
udev_rules.c
udev_rules.h
udevd.c
udevstart.c

diff --git a/udev.c b/udev.c
index f808abf..6387d0b 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -165,7 +165,7 @@ int main(int argc, char *argv[], char *envp[])
                                char program[PATH_SIZE];
 
                                strlcpy(program, name_loop->name, sizeof(program));
-                               apply_format(udev, program, sizeof(program));
+                               udev_rules_apply_format(udev, program, sizeof(program));
                                run_program(program, udev->dev->subsystem, NULL, 0, NULL, (udev_log_priority >= LOG_INFO));
                        }
                }
index fbcbbe0..90dc024 100644 (file)
@@ -362,7 +362,7 @@ static int wait_for_sysfs(struct udevice *udev, const char *file, int timeout)
        return -1;
 }
 
-void apply_format(struct udevice *udev, char *string, size_t maxsize)
+void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
 {
        char temp[PATH_SIZE];
        char temp2[PATH_SIZE];
@@ -818,7 +818,7 @@ try_parent:
                char result[PATH_SIZE];
 
                strlcpy(program, key_val(rule, &rule->program), sizeof(program));
-               apply_format(udev, program, sizeof(program));
+               udev_rules_apply_format(udev, program, sizeof(program));
                if (run_program(program, udev->dev->subsystem, result, sizeof(result), NULL, (udev_log_priority >= LOG_INFO)) != 0) {
                        dbg("PROGRAM is false");
                        udev->program_result[0] = '\0';
@@ -851,7 +851,7 @@ try_parent:
                int rc = -1;
 
                strlcpy(import, key_val(rule, &rule->import), sizeof(import));
-               apply_format(udev, import, sizeof(import));
+               udev_rules_apply_format(udev, import, sizeof(import));
                dbg("check for IMPORT import='%s'", import);
                if (rule->import_type == IMPORT_PROGRAM) {
                        rc = import_program_into_env(udev, import);
@@ -941,14 +941,14 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev)
                                if (rule->owner.operation == KEY_OP_ASSIGN_FINAL)
                                        udev->owner_final = 1;
                                strlcpy(udev->owner, key_val(rule, &rule->owner), sizeof(udev->owner));
-                               apply_format(udev, udev->owner, sizeof(udev->owner));
+                               udev_rules_apply_format(udev, udev->owner, sizeof(udev->owner));
                                dbg("applied owner='%s' to '%s'", udev->owner, udev->dev->kernel_name);
                        }
                        if (!udev->group_final && rule->group.operation != KEY_OP_UNSET) {
                                if (rule->group.operation == KEY_OP_ASSIGN_FINAL)
                                        udev->group_final = 1;
                                strlcpy(udev->group, key_val(rule, &rule->group), sizeof(udev->group));
-                               apply_format(udev, udev->group, sizeof(udev->group));
+                               udev_rules_apply_format(udev, udev->group, sizeof(udev->group));
                                dbg("applied group='%s' to '%s'", udev->group, udev->dev->kernel_name);
                        }
 
@@ -965,7 +965,7 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev)
                                        name_list_cleanup(&udev->symlink_list);
                                }
                                strlcpy(temp, key_val(rule, &rule->symlink), sizeof(temp));
-                               apply_format(udev, temp, sizeof(temp));
+                               udev_rules_apply_format(udev, temp, sizeof(temp));
                                count = replace_untrusted_chars(temp);
                                if (count)
                                        info("%i untrusted character(s) replaced" , count);
@@ -996,7 +996,7 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev)
                                int count;
                                name_set = 1;
                                strlcpy(udev->name, key_val(rule, &rule->name), sizeof(udev->name));
-                               apply_format(udev, udev->name, sizeof(udev->name));
+                               udev_rules_apply_format(udev, udev->name, sizeof(udev->name));
                                count = replace_untrusted_chars(udev->name);
                                if (count)
                                        info("%i untrusted character(s) replaced", count);
@@ -1082,7 +1082,7 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
                                        name_list_cleanup(&udev->run_list);
                                }
                                strlcpy(program, key_val(rule, &rule->run), sizeof(program));
-                               apply_format(udev, program, sizeof(program));
+                               udev_rules_apply_format(udev, program, sizeof(program));
                                dbg("add run '%s'", program);
                                name_list_add(&udev->run_list, program, 0);
                                if (rule->run.operation == KEY_OP_ASSIGN_FINAL)
index b183d9b..e4d5ebd 100644 (file)
@@ -105,8 +105,6 @@ struct udev_rules {
 extern int udev_rules_init(struct udev_rules *rules, int resolve_names);
 extern void udev_rules_cleanup(struct udev_rules *rules);
 
-extern void apply_format(struct udevice *udev, char *string, size_t maxsize);
-
 extern void udev_rules_iter_init(struct udev_rules *rules);
 extern struct udev_rule *udev_rules_iter_next(struct udev_rules *rules);
 extern struct udev_rule *udev_rules_iter_label(struct udev_rules *rules, const char *label);
@@ -114,4 +112,6 @@ extern struct udev_rule *udev_rules_iter_label(struct udev_rules *rules, const c
 extern int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev);
 extern int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev);
 
+extern void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize);
+
 #endif
diff --git a/udevd.c b/udevd.c
index 8a352e1..4ed2f94 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -127,7 +127,7 @@ static int udev_event_process(struct uevent_msg *msg)
                                char program[PATH_SIZE];
 
                                strlcpy(program, name_loop->name, sizeof(program));
-                               apply_format(udev, program, sizeof(program));
+                               udev_rules_apply_format(udev, program, sizeof(program));
                                if (run_program(program, udev->dev->subsystem, NULL, 0, NULL,
                                                (udev_log_priority >= LOG_INFO)))
                                        retval = -1;
index 11bdf79..fdb2ae3 100644 (file)
@@ -164,7 +164,7 @@ run:
                                char program[PATH_SIZE];
 
                                strlcpy(program, name_loop->name, sizeof(program));
-                               apply_format(udev, program, sizeof(program));
+                               udev_rules_apply_format(udev, program, sizeof(program));
                                run_program(program, udev->dev->subsystem, NULL, 0, NULL, (udev_log_priority >= LOG_INFO));
                        }
                }