console: lxc_terminal_signal_init()

parent 9bafc8cb
...@@ -131,7 +131,7 @@ int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata, ...@@ -131,7 +131,7 @@ int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
return 0; return 0;
} }
struct lxc_tty_state *lxc_console_signal_init(int srcfd, int dstfd) struct lxc_tty_state *lxc_terminal_signal_init(int srcfd, int dstfd)
{ {
int ret; int ret;
bool istty; bool istty;
...@@ -556,7 +556,7 @@ static int lxc_console_peer_proxy_alloc(struct lxc_pty *console, int sockfd) ...@@ -556,7 +556,7 @@ static int lxc_console_peer_proxy_alloc(struct lxc_pty *console, int sockfd)
if (lxc_setup_tios(console->peerpty.slave, &oldtermio) < 0) if (lxc_setup_tios(console->peerpty.slave, &oldtermio) < 0)
goto err1; goto err1;
ts = lxc_console_signal_init(console->peerpty.master, console->master); ts = lxc_terminal_signal_init(console->peerpty.master, console->master);
if (!ts) if (!ts)
goto err1; goto err1;
...@@ -670,7 +670,7 @@ static int lxc_console_peer_default(struct lxc_pty *console) ...@@ -670,7 +670,7 @@ static int lxc_console_peer_default(struct lxc_pty *console)
goto on_error1; goto on_error1;
} }
ts = lxc_console_signal_init(console->peer, console->master); ts = lxc_terminal_signal_init(console->peer, console->master);
console->tty_state = ts; console->tty_state = ts;
if (!ts) { if (!ts) {
WARN("Failed to install signal handler"); WARN("Failed to install signal handler");
...@@ -1010,7 +1010,7 @@ int lxc_console(struct lxc_container *c, int ttynum, ...@@ -1010,7 +1010,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
if (ret < 0) if (ret < 0)
TRACE("Process is already group leader"); TRACE("Process is already group leader");
ts = lxc_console_signal_init(stdinfd, masterfd); ts = lxc_terminal_signal_init(stdinfd, masterfd);
if (!ts) { if (!ts) {
ret = -1; ret = -1;
goto close_fds; goto close_fds;
......
...@@ -184,7 +184,7 @@ extern int lxc_setup_tios(int fd, struct termios *oldtios); ...@@ -184,7 +184,7 @@ extern int lxc_setup_tios(int fd, struct termios *oldtios);
extern void lxc_terminal_winsz(int srcfd, int dstfd); extern void lxc_terminal_winsz(int srcfd, int dstfd);
/* /*
* lxc_console_signal_init: install signal handler * lxc_terminal_signal_init: install signal handler
* *
* @srcfd : src for winsz in SIGWINCH handler * @srcfd : src for winsz in SIGWINCH handler
* @dstfd : dst for winsz in SIGWINCH handler * @dstfd : dst for winsz in SIGWINCH handler
...@@ -205,7 +205,7 @@ extern void lxc_terminal_winsz(int srcfd, int dstfd); ...@@ -205,7 +205,7 @@ extern void lxc_terminal_winsz(int srcfd, int dstfd);
* *
* This function allocates memory. It is up to the caller to free it. * This function allocates memory. It is up to the caller to free it.
*/ */
extern struct lxc_tty_state *lxc_console_signal_init(int srcfd, int dstfd); extern struct lxc_tty_state *lxc_terminal_signal_init(int srcfd, int dstfd);
/* /*
* Handler for signal events. To be registered via the corresponding functions * Handler for signal events. To be registered via the corresponding functions
...@@ -217,10 +217,10 @@ extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata, ...@@ -217,10 +217,10 @@ extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
/* /*
* lxc_console_signal_fini: uninstall signal handler * lxc_console_signal_fini: uninstall signal handler
* *
* @ts : the lxc_tty_state returned by lxc_console_signal_init * @ts : the lxc_tty_state returned by lxc_terminal_signal_init
* *
* Restore the saved signal handler that was in effect at the time * Restore the saved signal handler that was in effect at the time
* lxc_console_signal_init() was called. * lxc_terminal_signal_init() was called.
* *
* Must be called with process_lock held to protect the lxc_ttys list, or * Must be called with process_lock held to protect the lxc_ttys list, or
* from a non-threaded context. * from a non-threaded context.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment