Browse Source

jail: properly initialize timens_fd

So we are safe for the future.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 3 years ago
parent
commit
31e0a46ded
1 changed files with 2 additions and 0 deletions
  1. 2 0
      jail/jail.c

+ 2 - 0
jail/jail.c

@@ -2775,6 +2775,8 @@ static void post_main(struct uloop_timeout *t)
 		if (opts.setns.time != -1) {
 			timens_fd = ns_open_pid("time", getpid());
 			setns_open(CLONE_NEWTIME);
+		} else {
+			timens_fd = -1;
 		}
 #endif