From 782013924f28b9ebadfcd9d1719939bcc344c548 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Tue, 10 Sep 2013 12:59:24 +0200 Subject: [PATCH] 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 --- udevtrigger.c | 26 +++++++++++++------------- 1 file 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); } } -- 2.25.1