From: Gabor Juhos Date: Tue, 10 Sep 2013 10:59:24 +0000 (+0200) Subject: udevtrigger: rename variables in scan_subdir X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=782013924f28b9ebadfcd9d1719939bcc344c548;p=oweals%2Fprocd.git 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 --- 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); } }