From: Christian Brauner Date: Sun, 18 Feb 2018 22:42:05 +0000 (+0100) Subject: start: close_ns() X-Git-Tag: lxc-3.0.0.beta1~22^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39cd919cb12c230c9cc8e17ae44c700c044bb539;p=thirdparty%2Flxc.git start: close_ns() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index ae0a21ebf..e29e88273 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -134,10 +134,11 @@ static void close_ns(int ns_fd[LXC_NS_MAX]) int i; for (i = 0; i < LXC_NS_MAX; i++) { - if (ns_fd[i] > -1) { - close(ns_fd[i]); - ns_fd[i] = -1; - } + if (ns_fd[i] < 0) + continue; + + close(ns_fd[i]); + ns_fd[i] = -EBADF; } }