jail: properly initialize timens_fd
authorDaniel Golle <daniel@makrotopia.org>
Thu, 26 Nov 2020 16:34:38 +0000 (16:34 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 27 Nov 2020 01:06:09 +0000 (01:06 +0000)
So we are safe for the future.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c

index 7ec6cd8281733868689cc885c08031d6ec8c783e..82ba4a59eb96f20fe92b4a801269382a808fb9e7 100644 (file)
@@ -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