From 7843001aa7d02bb4d4d6be3f448479a847a8a780 Mon Sep 17 00:00:00 2001 From: Gao feng Date: Fri, 23 Oct 2015 17:53:34 +0800 Subject: [PATCH] initialize errev fd it can not be 0, 0 is an useful fd, this will cause weird closing of ptmx fd. Signed-off-by: Gao feng --- src/parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parse.c b/src/parse.c index 040016b..dfb11e3 100644 --- a/src/parse.c +++ b/src/parse.c @@ -226,6 +226,7 @@ static int hyper_parse_container(struct hyper_pod *pod, struct hyper_container * c->exec.init = 1; c->exec.code = -1; c->exec.e.fd = -1; + c->exec.errev.fd = -1; c->exec.ptyfd = -1; c->exec.errfd = -1; c->ns = -1; @@ -617,6 +618,7 @@ realloc: exec->ptyfd = -1; exec->errfd = -1; exec->e.fd = -1; + exec->errev.fd = -1; INIT_LIST_HEAD(&exec->list); for (i = 0, j = 0; i < n; i++) {