[CRIU] [PATCH 1/8] epoll: Eliminate potential variable shadowing

Cyrill Gorcunov gorcunov at gmail.com
Tue Mar 26 21:49:45 MSK 2019


The variable t is used in two contexts and compiler
is smart enough to allocate separate space for each,
still better be on safe size and use different names.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 criu/eventpoll.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/criu/eventpoll.c b/criu/eventpoll.c
index e1384fa4b116..40ecd398e89a 100644
--- a/criu/eventpoll.c
+++ b/criu/eventpoll.c
@@ -124,10 +124,10 @@ static void dequeue_dinfo(struct eventpoll_dinfo *dinfo)
 
 int flush_eventpoll_dinfo_queue(void)
 {
-	struct eventpoll_dinfo *dinfo, *t;
+	struct eventpoll_dinfo *dinfo, *tmp;
 	ssize_t i;
 
-	list_for_each_entry_safe(dinfo, t, &dinfo_list, list) {
+	list_for_each_entry_safe(dinfo, tmp, &dinfo_list, list) {
 		EventpollFileEntry *e = dinfo->e;
 
 		for (i = 0; i < e->n_tfd; i++) {
@@ -177,7 +177,7 @@ int flush_eventpoll_dinfo_queue(void)
 	return 0;
 
 err:
-	list_for_each_entry_safe(dinfo, t, &dinfo_list, list)
+	list_for_each_entry_safe(dinfo, tmp, &dinfo_list, list)
 		dequeue_dinfo(dinfo);
 
 	return -1;
-- 
2.20.1



More information about the CRIU mailing list