[CRIU] [PATCH 13/13] pstree: fix error handling

Andrey Vagin avagin at openvz.org
Wed Apr 3 13:31:12 EDT 2013


pstree.c:273:3: warning: Value stored to 'ret' is never read
                ret = 0;
                ^     ~

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 pstree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pstree.c b/pstree.c
index b910721..7663a23 100644
--- a/pstree.c
+++ b/pstree.c
@@ -270,7 +270,6 @@ static int read_pstree_image(void)
 		if (!pi->threads)
 			break;
 
-		ret = 0;
 		for (i = 0; i < e->n_threads; i++)
 			pi->threads[i].virt = e->threads[i];
 
@@ -283,7 +282,7 @@ static int read_pstree_image(void)
 		if (fd < 0) {
 			if (errno == ENOENT)
 				continue;
-			return -1;
+			goto err;
 		}
 		ret = pb_read_one(fd, &pi->ids, PB_IDS);
 		close(fd);
-- 
1.7.11.7



More information about the CRIU mailing list