console: lxc_terminal_allocate()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-02-27 16:38:12 +01:00
parent 93ed49903f
commit c1ee47cd79
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
3 changed files with 6 additions and 6 deletions

View File

@ -748,7 +748,7 @@ static int lxc_cmd_console_callback(int fd, struct lxc_cmd_req *req,
struct lxc_cmd_rsp rsp;
int ttynum = PTR_TO_INT(req->data);
masterfd = lxc_console_allocate(handler->conf, fd, &ttynum);
masterfd = lxc_terminal_allocate(handler->conf, fd, &ttynum);
if (masterfd < 0)
goto out_close;

View File

@ -451,7 +451,7 @@ int lxc_terminal_mainloop_add(struct lxc_epoll_descr *descr,
}
/* We cache the descr so that we can add an fd to it when someone
* does attach to it in lxc_console_allocate().
* does attach to it in lxc_terminal_allocate().
*/
console->descr = descr;
ret = lxc_terminal_mainloop_add_peer(console);
@ -575,7 +575,7 @@ err1:
return -1;
}
int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
{
int masterfd = -1, ttynum;
struct lxc_tty_info *tty_info = &conf->tty_info;

View File

@ -61,14 +61,14 @@ struct lxc_tty_state
};
/*
* lxc_console_allocate: allocate the console or a tty
* lxc_terminal_allocate: allocate the console or a tty
*
* @conf : the configuration of the container to allocate from
* @sockfd : the socket fd whose remote side when closed, will be an
* indication that the console or tty is no longer in use
* @ttyreq : the tty requested to be opened, -1 for any, 0 for the console
*/
extern int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttynum);
extern int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttynum);
/*
* Create a new pty:
@ -102,7 +102,7 @@ extern void lxc_console_delete(struct lxc_pty *);
/*
* lxc_console_free: mark the console or a tty as unallocated, free any
* resources allocated by lxc_console_allocate().
* resources allocated by lxc_terminal_allocate().
*
* @conf : the configuration of the container whose tty was closed
* @fd : the socket fd whose remote side was closed, which indicated