From: Christian Brauner Date: Mon, 4 May 2020 13:50:41 +0000 (+0200) Subject: terminal: remove unneeded if condition X-Git-Tag: lxc-5.0.0~441^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3398%2Fhead;p=thirdparty%2Flxc.git terminal: remove unneeded if condition Fixes: Coverity 1461742. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c index c2516b205..c883b1c8c 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1167,10 +1167,7 @@ int lxc_terminal_map_ids(struct lxc_conf *c, struct lxc_terminal *terminal) if (strcmp(terminal->name, "") == 0) return 0; - if (terminal->slave >= 0) - ret = userns_exec_mapped_root(terminal->name, terminal->slave, c); - else - ret = userns_exec_mapped_root(terminal->name, terminal->slave, c); + ret = userns_exec_mapped_root(terminal->name, terminal->slave, c); if (ret < 0) { return log_error(-1, "Failed to chown terminal %d(%s)", terminal->slave, terminal->name);