diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-16 20:12:16 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-16 20:12:16 +0200 |
commit | daa849db6faf73fd712b6ff8fc63adcd7d82f178 (patch) | |
tree | b65ceb8cb11492d0d7badfdbbc1e8529fcb8aca3 /udev/udev-util.c | |
parent | 7db6580f42325bedf88c8e5b79956545e0b07eb6 (diff) |
udev-rules-parse: name_list -> udev_list
Diffstat (limited to 'udev/udev-util.c')
-rw-r--r-- | udev/udev-util.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/udev/udev-util.c b/udev/udev-util.c index 4623c30caf..e22e9b285a 100644 --- a/udev/udev-util.c +++ b/udev/udev-util.c @@ -122,49 +122,6 @@ void name_list_cleanup(struct udev *udev, struct list_head *name_list) } } -/* calls function for every file found in specified directory */ -int add_matching_files(struct udev *udev, struct list_head *name_list, const char *dirname, const char *suffix) -{ - struct dirent *ent; - DIR *dir; - char filename[UTIL_PATH_SIZE]; - - dbg(udev, "open directory '%s'\n", dirname); - dir = opendir(dirname); - if (dir == NULL) { - err(udev, "unable to open '%s': %m\n", dirname); - return -1; - } - - while (1) { - ent = readdir(dir); - if (ent == NULL || ent->d_name[0] == '\0') - break; - - if ((ent->d_name[0] == '.') || (ent->d_name[0] == '#')) - continue; - - /* look for file matching with specified suffix */ - if (suffix != NULL) { - const char *ext; - - ext = strrchr(ent->d_name, '.'); - if (ext == NULL) - continue; - if (strcmp(ext, suffix) != 0) - continue; - } - dbg(udev, "put file '%s/%s' into list\n", dirname, ent->d_name); - - snprintf(filename, sizeof(filename), "%s/%s", dirname, ent->d_name); - filename[sizeof(filename)-1] = '\0'; - name_list_add(udev, name_list, filename, 1); - } - - closedir(dir); - return 0; -} - uid_t lookup_user(struct udev *udev, const char *user) { struct passwd *pw; @@ -200,4 +157,3 @@ extern gid_t lookup_group(struct udev *udev, const char *group) return gid; } - |