Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
9bafc8cb
Unverified
Commit
9bafc8cb
authored
Feb 27, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
console: lxc_terminal_signalfd_cb()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
8ccbbf94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
console.c
src/lxc/console.c
+5
-5
console.h
src/lxc/console.h
+2
-2
No files found.
src/lxc/console.c
View file @
9bafc8cb
...
...
@@ -107,8 +107,8 @@ void lxc_terminal_sigwinch(int sig)
}
}
int
lxc_
console_cb_signal_fd
(
int
fd
,
uint32_t
events
,
void
*
cbdata
,
struct
lxc_epoll_descr
*
descr
)
int
lxc_
terminal_signalfd_cb
(
int
fd
,
uint32_t
events
,
void
*
cbdata
,
struct
lxc_epoll_descr
*
descr
)
{
ssize_t
ret
;
struct
signalfd_siginfo
siginfo
;
...
...
@@ -121,7 +121,7 @@ int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata,
}
if
(
siginfo
.
ssi_signo
==
SIGTERM
)
{
DEBUG
(
"Received SIGTERM. Detaching from the
console
"
);
DEBUG
(
"Received SIGTERM. Detaching from the
terminal
"
);
return
LXC_MAINLOOP_CLOSE
;
}
...
...
@@ -424,7 +424,7 @@ static int lxc_console_mainloop_add_peer(struct lxc_pty *console)
return
0
;
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
)
{
WARN
(
"Failed to add signal handler to mainloop"
);
return
-
1
;
...
...
@@ -1036,7 +1036,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
if
(
ts
->
sigfd
!=
-
1
)
{
ret
=
lxc_mainloop_add_handler
(
&
descr
,
ts
->
sigfd
,
lxc_
console_cb_signal_fd
,
ts
);
lxc_
terminal_signalfd_cb
,
ts
);
if
(
ret
<
0
)
{
ERROR
(
"Failed to add signal handler to mainloop"
);
goto
close_mainloop
;
...
...
src/lxc/console.h
View file @
9bafc8cb
...
...
@@ -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
* 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
* 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.
*/
...
...
@@ -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
* 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
);
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment