Skip to content

Commit

Permalink
console: lxc_terminal_mainloop_add()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 27, 2018
1 parent 22b183e commit 093bce5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lxc/attach.c
Expand Up @@ -1012,7 +1012,7 @@ static int lxc_attach_pty_mainloop_init(struct lxc_pty *pty,
return -1;
}

ret = lxc_console_mainloop_add(descr, pty);
ret = lxc_terminal_mainloop_add(descr, pty);
if (ret < 0) {
ERROR("Failed to add handlers to mainloop");
lxc_mainloop_close(descr);
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/console.c
Expand Up @@ -433,7 +433,7 @@ static int lxc_terminal_mainloop_add_peer(struct lxc_pty *console)
return 0;
}

int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
int lxc_terminal_mainloop_add(struct lxc_epoll_descr *descr,
struct lxc_pty *console)
{
int ret;
Expand Down
8 changes: 4 additions & 4 deletions src/lxc/console.h
Expand Up @@ -114,7 +114,7 @@ extern void lxc_console_free(struct lxc_conf *conf, int fd);
/*
* Register pty event handlers in an open mainloop
*/
extern int lxc_console_mainloop_add(struct lxc_epoll_descr *, struct lxc_pty *);
extern int lxc_terminal_mainloop_add(struct lxc_epoll_descr *, struct lxc_pty *);

/*
* Handle SIGWINCH events on the allocated ptys.
Expand Down Expand Up @@ -153,7 +153,7 @@ extern int lxc_console_set_stdfds(int fd);
/*
* Handler for events on the stdin fd of the pty. To be registered via the
* corresponding functions declared and defined in mainloop.{c,h} or
* lxc_console_mainloop_add().
* lxc_terminal_mainloop_add().
* This function exits the loop cleanly when an EPOLLHUP event is received.
*/
extern int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
Expand All @@ -162,7 +162,7 @@ extern int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
/*
* Handler for events on the master fd of the pty. To be registered via the
* corresponding functions declared and defined in mainloop.{c,h} or
* lxc_console_mainloop_add().
* lxc_terminal_mainloop_add().
* This function exits the loop cleanly when an EPOLLHUP event is received.
*/
extern int lxc_console_cb_tty_master(int fd, uint32_t events, void *cbdata,
Expand Down Expand Up @@ -209,7 +209,7 @@ extern struct lxc_tty_state *lxc_terminal_signal_init(int srcfd, int dstfd);

/*
* 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_terminal_mainloop_add().
*/
extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr);
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/start.c
Expand Up @@ -531,13 +531,13 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
if (has_console) {
struct lxc_pty *console = &handler->conf->console;

ret = lxc_console_mainloop_add(&descr, console);
ret = lxc_terminal_mainloop_add(&descr, console);
if (ret < 0) {
ERROR("Failed to add console handlers to mainloop");
goto out_mainloop_console;
}

ret = lxc_console_mainloop_add(&descr_console, console);
ret = lxc_terminal_mainloop_add(&descr_console, console);
if (ret < 0) {
ERROR("Failed to add console handlers to console mainloop");
goto out_mainloop_console;
Expand Down

0 comments on commit 093bce5

Please sign in to comment.