[RFC PATCH 10/15] [refactor] get_id_list: use different variable for id

Ákos Uzonyi uzonyi.akos at gmail.com
Mon Jun 1 11:44:39 UTC 2020


---
 pidns.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pidns.c b/pidns.c
index ef1e6d59..3743303d 100644
--- a/pidns.c
+++ b/pidns.c
@@ -219,7 +219,7 @@ get_id_list(int proc_pid, int *id_buf, enum pid_type type)
 				break;
 
 			errno = 0;
-			ret = strtol(p, &endp, 10);
+			int id = strtol(p, &endp, 10);
 
 			if (errno && (p[0] != '\t')) {
 				perror_msg("get_id_list: converting pid to int");
@@ -228,11 +228,11 @@ get_id_list(int proc_pid, int *id_buf, enum pid_type type)
 			}
 
 			if (debug_flag)
-				error_msg("PID %d: %s[%d]: %zd",
-					  proc_pid, ns_str, idx, ret);
+				error_msg("PID %d: %s[%d]: %d",
+					  proc_pid, ns_str, idx, id);
 
 			if (id_buf)
-				id_buf[idx] = ret;
+				id_buf[idx] = id;
 
 			strsep(&p, "\t");
 		}
-- 
2.26.2



More information about the Strace-devel mailing list