[CRIU] [PATCH] ns: Fix error return value in __get_ns_id()

Kirill Tkhai ktkhai at virtuozzo.com
Tue Jan 10 00:17:42 PST 2017


Function has unsigned int return value, and error is coded by 0, not -1.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/namespaces.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/namespaces.c b/criu/namespaces.c
index c09c60bc4..b954f9796 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -449,7 +449,7 @@ static unsigned int __get_ns_id(int pid, struct ns_desc *nd, protobuf_c_boolean
 			goto out;
 		}
 		pr_perror("Unable to stat %s", ns_path);
-		return -1;
+		return 0;
 	}
 	kid = st.st_ino;
 	BUG_ON(!kid);



More information about the CRIU mailing list