Skip to contentSkip to conversation

autofs-5.1.2: Avoid local variable name shadowing another

PATCH New Tomohiro Kusumi 1 participant 1 message Aug 28, 2016 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autofs-5.1.2: Avoid local variable name shadowing another

There are two local variabls int ret, and the one in the inner scope doesn't need to be named as int ret.

---
 daemon/automount.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
daemon/automount.c +1 -5
index ca5e090..63e139d 100644
@@ -310,17 +310,13 @@ static int walk_tree(const char *base, int (*fn) (struct autofs_point *ap,
 				return -1;
 
 			while (n--) {
-				int ret, size;
-
 				if (strcmp(de[n]->d_name, ".") == 0 ||
 				    strcmp(de[n]->d_name, "..") == 0) {
 					free(de[n]);
 					continue;
 				}
 
-				size = sizeof(buf);
-				ret = cat_path(buf, size, base, de[n]->d_name);
-				if (!ret) {
+				if (!cat_path(buf, sizeof(buf), base, de[n]->d_name)) {
 					do {
 						free(de[n]);
 					} while (n--);
Signature · 4 lines
2.5.5

--
To unsubscribe from this list: send the line "unsubscribe autofs" in