From 65e8eb7a2d78bfe02173fca78ce41d09d1063b2d Mon Sep 17 00:00:00 2001 From: Kinsbursky Stanislav Date: Wed, 8 Feb 2012 17:29:54 +0300 Subject: [PATCH] show: check UTS ns fd before show Signed-off-by: Stanislav Kinsbursky Acked-by: Pavel Emelyanov Signed-off-by: Cyrill Gorcunov --- namespaces.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/namespaces.c b/namespaces.c index 75ae14234..882e5758b 100644 --- a/namespaces.c +++ b/namespaces.c @@ -122,7 +122,8 @@ int try_show_namespaces(int ns_pid) if (!fdset) return -1; - show_utsns(fdset->fds[CR_FD_UTSNS]); + if (fdset->fds[CR_FD_UTSNS] != -1) + show_utsns(fdset->fds[CR_FD_UTSNS]); close_cr_fdset(&fdset); return 0;