From: Christian Brauner Date: Tue, 27 Feb 2018 17:42:25 +0000 (+0100) Subject: conf: s/peerpty/proxy/ X-Git-Tag: lxc-3.0.0.beta1~5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb87aa6a94521517d332718c9fa83465da6ca57f;p=thirdparty%2Flxc.git conf: s/peerpty/proxy/ Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 9ab400e74..a6635a348 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2613,9 +2613,9 @@ struct lxc_conf *lxc_conf_init(void) new->console.log_size = 0; new->console.path = NULL; new->console.peer = -1; - new->console.peerpty.busy = -1; - new->console.peerpty.master = -1; - new->console.peerpty.slave = -1; + new->console.proxy.busy = -1; + new->console.proxy.master = -1; + new->console.proxy.slave = -1; new->console.master = -1; new->console.slave = -1; new->console.name[0] = '\0'; diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c index 05a524606..93c70a098 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -515,12 +515,12 @@ static void lxc_terminal_peer_proxy_free(struct lxc_terminal *terminal) lxc_terminal_signal_fini(terminal->tty_state); terminal->tty_state = NULL; } - close(terminal->peerpty.master); - close(terminal->peerpty.slave); - terminal->peerpty.master = -1; - terminal->peerpty.slave = -1; - terminal->peerpty.busy = -1; - terminal->peerpty.name[0] = '\0'; + close(terminal->proxy.master); + close(terminal->proxy.slave); + terminal->proxy.master = -1; + terminal->proxy.slave = -1; + terminal->proxy.busy = -1; + terminal->proxy.name[0] = '\0'; terminal->peer = -1; } @@ -534,7 +534,7 @@ static int lxc_terminal_peer_proxy_alloc(struct lxc_terminal *terminal, int sock ERROR("Terminal not set up"); return -1; } - if (terminal->peerpty.busy != -1 || terminal->peer != -1) { + if (terminal->proxy.busy != -1 || terminal->peer != -1) { NOTICE("Terminal already in use"); return -1; } @@ -546,28 +546,28 @@ static int lxc_terminal_peer_proxy_alloc(struct lxc_terminal *terminal, int sock /* this is the proxy pty that will be given to the client, and that * the real pty master will send to / recv from */ - ret = openpty(&terminal->peerpty.master, &terminal->peerpty.slave, - terminal->peerpty.name, NULL, NULL); + ret = openpty(&terminal->proxy.master, &terminal->proxy.slave, + terminal->proxy.name, NULL, NULL); if (ret) { SYSERROR("failed to create proxy pty"); return -1; } - if (lxc_setup_tios(terminal->peerpty.slave, &oldtermio) < 0) + if (lxc_setup_tios(terminal->proxy.slave, &oldtermio) < 0) goto err1; - ts = lxc_terminal_signal_init(terminal->peerpty.master, terminal->master); + ts = lxc_terminal_signal_init(terminal->proxy.master, terminal->master); if (!ts) goto err1; terminal->tty_state = ts; - terminal->peer = terminal->peerpty.slave; - terminal->peerpty.busy = sockfd; + terminal->peer = terminal->proxy.slave; + terminal->proxy.busy = sockfd; ret = lxc_terminal_mainloop_add_peer(terminal); if (ret < 0) goto err1; - DEBUG("%d peermaster:%d sockfd:%d", lxc_raw_getpid(), terminal->peerpty.master, sockfd); + DEBUG("%d peermaster:%d sockfd:%d", lxc_raw_getpid(), terminal->proxy.master, sockfd); return 0; err1: @@ -584,7 +584,7 @@ int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq) if (*ttyreq == 0) { if (lxc_terminal_peer_proxy_alloc(terminal, sockfd) < 0) goto out; - masterfd = terminal->peerpty.master; + masterfd = terminal->proxy.master; goto out; } @@ -628,8 +628,8 @@ void lxc_terminal_free(struct lxc_conf *conf, int fd) ttys->tty[i].busy = 0; } - if (terminal->peerpty.busy == fd) { - lxc_mainloop_del_handler(terminal->descr, terminal->peerpty.slave); + if (terminal->proxy.busy == fd) { + lxc_mainloop_del_handler(terminal->descr, terminal->proxy.slave); lxc_terminal_peer_proxy_free(terminal); } } @@ -1143,7 +1143,7 @@ void lxc_terminal_init(struct lxc_terminal *pty) pty->master = -EBADF; pty->peer = -EBADF; pty->log_fd = -EBADF; - lxc_terminal_info_init(&pty->peerpty); + lxc_terminal_info_init(&pty->proxy); } void lxc_terminal_conf_free(struct lxc_terminal *terminal) diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h index 77b6f18bd..e9b95c434 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -79,7 +79,7 @@ struct lxc_terminal { int slave; int master; int peer; - struct lxc_terminal_info peerpty; + struct lxc_terminal_info proxy; struct lxc_epoll_descr *descr; char *path; char name[MAXPATHLEN];