diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-09-10 12:59:24 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-09-10 13:25:35 +0200 |
commit | 782013924f28b9ebadfcd9d1719939bcc344c548 (patch) | |
tree | 292de9ccc01f6d9da59c68d9e4eabd0112f36d39 | |
parent | 92b3b9ae934a631d9f872c66e39fc2f82e05a642 (diff) | |
download | unitd-782013924f28b9ebadfcd9d1719939bcc344c548.tar unitd-782013924f28b9ebadfcd9d1719939bcc344c548.zip |
udevtrigger: rename variables in scan_subdir
There are only one variable present for a given
type. Remove the '2' suffix from the variable
names. Also rename the function argument to avoid
name collision.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-rw-r--r-- | udevtrigger.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/udevtrigger.c b/udevtrigger.c index fd293a4..98b0743 100644 --- a/udevtrigger.c +++ b/udevtrigger.c @@ -179,25 +179,25 @@ static int device_list_insert(const char *path) return 0; } -static void scan_subdir(const char *dirname) +static void scan_subdir(const char *base) { - DIR *dir2; - struct dirent *dent2; + DIR *dir; + struct dirent *dent; - dir2 = opendir(dirname); - if (dir2 != NULL) { - for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) { - char dirname2[PATH_SIZE]; + dir = opendir(base); + if (dir != NULL) { + for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { + char dirname[PATH_SIZE]; - if (dent2->d_name[0] == '.') + if (dent->d_name[0] == '.') continue; - strlcpy(dirname2, dirname, sizeof(dirname2)); - strlcat(dirname2, "/", sizeof(dirname2)); - strlcat(dirname2, dent2->d_name, sizeof(dirname2)); - device_list_insert(dirname2); + strlcpy(dirname, base, sizeof(dirname)); + strlcat(dirname, "/", sizeof(dirname)); + strlcat(dirname, dent->d_name, sizeof(dirname)); + device_list_insert(dirname); } - closedir(dir2); + closedir(dir); } } |