udevtrigger: rename variables in scan_subdir
authorGabor Juhos <juhosg@openwrt.org>
Tue, 10 Sep 2013 10:59:24 +0000 (12:59 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 10 Sep 2013 11:25:35 +0000 (13:25 +0200)
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>
udevtrigger.c

index fd293a4645647ca3550d6966d18e463613f7ca48..98b074349ab45c889f911e80e92e8c8182fad7d0 100644 (file)
@@ -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);
        }
 }