console: lxc_terminal_signalfd_cb()

parent 8ccbbf94
...@@ -107,8 +107,8 @@ void lxc_terminal_sigwinch(int sig) ...@@ -107,8 +107,8 @@ void lxc_terminal_sigwinch(int sig)
} }
} }
int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata, int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr) struct lxc_epoll_descr *descr)
{ {
ssize_t ret; ssize_t ret;
struct signalfd_siginfo siginfo; struct signalfd_siginfo siginfo;
...@@ -121,7 +121,7 @@ int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata, ...@@ -121,7 +121,7 @@ int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata,
} }
if (siginfo.ssi_signo == SIGTERM) { if (siginfo.ssi_signo == SIGTERM) {
DEBUG("Received SIGTERM. Detaching from the console"); DEBUG("Received SIGTERM. Detaching from the terminal");
return LXC_MAINLOOP_CLOSE; return LXC_MAINLOOP_CLOSE;
} }
...@@ -424,7 +424,7 @@ static int lxc_console_mainloop_add_peer(struct lxc_pty *console) ...@@ -424,7 +424,7 @@ static int lxc_console_mainloop_add_peer(struct lxc_pty *console)
return 0; return 0;
ret = lxc_mainloop_add_handler(console->descr, console->tty_state->sigfd, ret = lxc_mainloop_add_handler(console->descr, console->tty_state->sigfd,
lxc_console_cb_signal_fd, console->tty_state); lxc_terminal_signalfd_cb, console->tty_state);
if (ret < 0) { if (ret < 0) {
WARN("Failed to add signal handler to mainloop"); WARN("Failed to add signal handler to mainloop");
return -1; return -1;
...@@ -1036,7 +1036,7 @@ int lxc_console(struct lxc_container *c, int ttynum, ...@@ -1036,7 +1036,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
if (ts->sigfd != -1) { if (ts->sigfd != -1) {
ret = lxc_mainloop_add_handler(&descr, ts->sigfd, ret = lxc_mainloop_add_handler(&descr, ts->sigfd,
lxc_console_cb_signal_fd, ts); lxc_terminal_signalfd_cb, ts);
if (ret < 0) { if (ret < 0) {
ERROR("Failed to add signal handler to mainloop"); ERROR("Failed to add signal handler to mainloop");
goto close_mainloop; goto close_mainloop;
......
...@@ -201,7 +201,7 @@ extern void lxc_terminal_winsz(int srcfd, int dstfd); ...@@ -201,7 +201,7 @@ extern void lxc_terminal_winsz(int srcfd, int dstfd);
* we're ready for it. This avoids deadlocks since a signal handler (ie * we're ready for it. This avoids deadlocks since a signal handler (ie
* lxc_terminal_sigwinch()) would need to take the thread mutex to prevent * lxc_terminal_sigwinch()) would need to take the thread mutex to prevent
* lxc_ttys list corruption, but using the fd we can provide the tty_state * lxc_ttys list corruption, but using the fd we can provide the tty_state
* needed to the callback (lxc_console_cb_signal_fd()). * needed to the callback (lxc_terminal_signalfd_cb()).
* *
* 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.
*/ */
...@@ -211,7 +211,7 @@ extern struct lxc_tty_state *lxc_console_signal_init(int srcfd, int dstfd); ...@@ -211,7 +211,7 @@ extern struct lxc_tty_state *lxc_console_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
* declared and defined in mainloop.{c,h} or lxc_console_mainloop_add(). * declared and defined in mainloop.{c,h} or lxc_console_mainloop_add().
*/ */
extern int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata, extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr); struct lxc_epoll_descr *descr);
/* /*
......
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