[git commit] setpriv: placete "declaration of 'index' shadows a global declaration" warning

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 29 13:34:38 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=0180b57aaf9fd18c2f54be508a1dc2a64f848ed1
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/setpriv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/util-linux/setpriv.c b/util-linux/setpriv.c
index 12ab1bd..af079fa 100644
--- a/util-linux/setpriv.c
+++ b/util-linux/setpriv.c
@@ -173,14 +173,14 @@ static void set_ambient_caps(char *string)
 
 	cap = strtok(string, ",");
 	while (cap) {
-		unsigned index;
+		unsigned idx;
 
-		index = parse_cap(cap);
+		idx = parse_cap(cap);
 		if (cap[0] == '+') {
-			if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, index, 0, 0) < 0)
+			if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, idx, 0, 0) < 0)
 				bb_perror_msg("cap_ambient_raise");
 		} else {
-			if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_LOWER, index, 0, 0) < 0)
+			if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_LOWER, idx, 0, 0) < 0)
 				bb_perror_msg("cap_ambient_lower");
 		}
 		cap = strtok(NULL, ",");


More information about the busybox-cvs mailing list