ns: Fix error return value in __get_ns_id()

Submitted by Kirill Tkhai on Jan. 10, 2017, 8:17 a.m.

Details

Message ID 148403621841.3625.7415614210319971858.stgit@localhost.localdomain
State Superseded
Series "ns: Fix error return value in __get_ns_id()"
Headers show

Commit Message

Kirill Tkhai Jan. 10, 2017, 8:17 a.m.
Function has unsigned int return value, and error is coded by 0, not -1.

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

Patch hide | download patch | download mbox

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);

Comments

Pavel Emelianov Jan. 11, 2017, 10:43 a.m.
Applied