mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 08:05:20 +00:00
console: lxc_terminal_setup()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
2083d59d98
commit
564e31c4b0
@ -870,7 +870,7 @@ err:
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lxc_terminal_create(struct lxc_conf *conf)
|
int lxc_terminal_setup(struct lxc_conf *conf)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct lxc_pty *terminal = &conf->console;
|
struct lxc_pty *terminal = &conf->console;
|
||||||
|
@ -85,15 +85,15 @@ extern int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttynum
|
|||||||
extern int lxc_pty_create(struct lxc_pty *console);
|
extern int lxc_pty_create(struct lxc_pty *console);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lxc_terminal_create: Create a new pty.
|
* lxc_terminal_setup: Create a new pty.
|
||||||
* - In addition to lxc_pty_create() also sets up all pty logs.
|
* - In addition to lxc_pty_create() also sets up all pty logs.
|
||||||
*/
|
*/
|
||||||
extern int lxc_terminal_create(struct lxc_conf *);
|
extern int lxc_terminal_setup(struct lxc_conf *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delete a pty created via lxc_terminal_create():
|
* Delete a pty created via lxc_terminal_setup():
|
||||||
* - set old terminal settings
|
* - set old terminal settings
|
||||||
* - memory allocated via lxc_terminal_create() is free()ed.
|
* - memory allocated via lxc_terminal_setup() is free()ed.
|
||||||
* - close master/slave pty pair and allocated fd for the peer (usually
|
* - close master/slave pty pair and allocated fd for the peer (usually
|
||||||
* /dev/tty)
|
* /dev/tty)
|
||||||
* Registered handlers in a mainloop are not automatically deleted.
|
* Registered handlers in a mainloop are not automatically deleted.
|
||||||
|
@ -804,7 +804,7 @@ int lxc_init(const char *name, struct lxc_handler *handler)
|
|||||||
TRACE("Set up signal fd");
|
TRACE("Set up signal fd");
|
||||||
|
|
||||||
/* Do this after setting up signals since it might unblock SIGWINCH. */
|
/* Do this after setting up signals since it might unblock SIGWINCH. */
|
||||||
ret = lxc_terminal_create(conf);
|
ret = lxc_terminal_setup(conf);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ERROR("Failed to create console");
|
ERROR("Failed to create console");
|
||||||
goto out_restore_sigmask;
|
goto out_restore_sigmask;
|
||||||
@ -1198,7 +1198,7 @@ static int do_start(void *data)
|
|||||||
/* Some init's such as busybox will set sane tty settings on stdin,
|
/* Some init's such as busybox will set sane tty settings on stdin,
|
||||||
* stdout, stderr which it thinks is the console. We already set them
|
* stdout, stderr which it thinks is the console. We already set them
|
||||||
* the way we wanted on the real terminal, and we want init to do its
|
* the way we wanted on the real terminal, and we want init to do its
|
||||||
* setup on its console ie. the pty allocated in lxc_terminal_create() so
|
* setup on its console ie. the pty allocated in lxc_terminal_setup() so
|
||||||
* make sure that that pty is stdin,stdout,stderr.
|
* make sure that that pty is stdin,stdout,stderr.
|
||||||
*/
|
*/
|
||||||
if (handler->conf->console.slave >= 0) {
|
if (handler->conf->console.slave >= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user