]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/conf.c
conf: improve tty shifting function
[mirror_lxc.git] / src / lxc / conf.c
index 7bed9a71650bc1a101b4943c3a93c1b7c073c4b3..6e6edb1934232ed3e9a842646ef0a283264f7e86 100644 (file)
@@ -3831,16 +3831,21 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
        return ret;
 }
 
-int ttys_shift_ids(struct lxc_conf *c)
+int lxc_ttys_shift_ids(struct lxc_conf *c)
 {
        if (lxc_list_empty(&c->id_map))
                return 0;
 
-       if (strcmp(c->console.name, "") !=0 && chown_mapped_root(c->console.name, c) < 0) {
-               ERROR("Failed to chown %s", c->console.name);
+       if (!strcmp(c->console.name, ""))
+               return 0;
+
+       if (chown_mapped_root(c->console.name, c) < 0) {
+               ERROR("failed to chown console \"%s\"", c->console.name);
                return -1;
        }
 
+       TRACE("chowned console \"%s\"", c->console.name);
+
        return 0;
 }