]> git.proxmox.com Git - mirror_lxc.git/commitdiff
terminal: remove unneeded if condition
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 May 2020 13:50:41 +0000 (15:50 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 May 2020 13:50:41 +0000 (15:50 +0200)
Fixes: Coverity 1461742.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/terminal.c

index c2516b205a028c1bbc7198a396c929266f47050b..c883b1c8cf6be841fed87f867ba2d459399e3da5 100644 (file)
@@ -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);