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
b3db9f63
Unverified
Commit
b3db9f63
authored
Jan 08, 2019
by
Stéphane Graber
Committed by
GitHub
Jan 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2753 from brauner/2018-12-13/remove_sigwinch_cmd
terminal: remove sigwinch command
parents
62aad75f
2bd158cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
56 deletions
+4
-56
commands.c
src/lxc/commands.c
+3
-15
terminal.c
src/lxc/terminal.c
+1
-35
terminal.h
src/lxc/terminal.h
+0
-6
No files found.
src/lxc/commands.c
View file @
b3db9f63
...
...
@@ -665,7 +665,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
}
/*
* lxc_cmd_terminal_winch:
To process as if a SIGWINCH were received
* lxc_cmd_terminal_winch:
noop
*
* @name : name of container to connect to
* @lxcpath : the lxcpath in which the container is running
...
...
@@ -674,26 +674,14 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
*/
int
lxc_cmd_terminal_winch
(
const
char
*
name
,
const
char
*
lxcpath
)
{
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_TERMINAL_WINCH
},
};
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
if
(
ret
<
0
)
return
ret
;
return
0
;
}
static
int
lxc_cmd_terminal_winch_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
)
{
struct
lxc_cmd_rsp
rsp
=
{
.
data
=
0
};
lxc_terminal_sigwinch
(
SIGWINCH
);
return
lxc_cmd_rsp_send
(
fd
,
&
rsp
);
/* should never be called */
return
-
1
;
}
/*
...
...
src/lxc/terminal.c
View file @
b3db9f63
...
...
@@ -59,15 +59,6 @@
lxc_log_define
(
terminal
,
lxc
);
static
struct
lxc_list
lxc_ttys
;
typedef
void
(
*
sighandler_t
)(
int
);
__attribute__
((
constructor
))
void
lxc_terminal_init_global
(
void
)
{
lxc_list_init
(
&
lxc_ttys
);
}
void
lxc_terminal_winsz
(
int
srcfd
,
int
dstfd
)
{
int
ret
;
...
...
@@ -95,20 +86,6 @@ void lxc_terminal_winsz(int srcfd, int dstfd)
static
void
lxc_terminal_winch
(
struct
lxc_terminal_state
*
ts
)
{
lxc_terminal_winsz
(
ts
->
stdinfd
,
ts
->
masterfd
);
if
(
ts
->
winch_proxy
)
lxc_cmd_terminal_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
}
void
lxc_terminal_sigwinch
(
int
sig
)
{
struct
lxc_list
*
it
;
struct
lxc_terminal_state
*
ts
;
lxc_list_for_each
(
it
,
&
lxc_ttys
)
{
ts
=
it
->
elem
;
lxc_terminal_winch
(
ts
);
}
}
int
lxc_terminal_signalfd_cb
(
int
fd
,
uint32_t
events
,
void
*
cbdata
,
...
...
@@ -161,9 +138,6 @@ struct lxc_terminal_state *lxc_terminal_signal_init(int srcfd, int dstfd)
if
(
!
istty
)
{
INFO
(
"fd %d does not refer to a tty device"
,
srcfd
);
}
else
{
/* Add tty to list to be scanned at SIGWINCH time. */
lxc_list_add_elem
(
&
ts
->
node
,
ts
);
lxc_list_add_tail
(
&
lxc_ttys
,
&
ts
->
node
);
ret
=
sigaddset
(
&
mask
,
SIGWINCH
);
if
(
ret
<
0
)
SYSNOTICE
(
"Failed to add SIGWINCH to signal set"
);
...
...
@@ -199,9 +173,6 @@ on_error:
ts
->
sigfd
=
-
1
;
}
if
(
istty
)
lxc_list_del
(
&
ts
->
node
);
return
ts
;
}
...
...
@@ -214,9 +185,6 @@ void lxc_terminal_signal_fini(struct lxc_terminal_state *ts)
SYSWARN
(
"Failed to restore signal mask"
);
}
if
(
isatty
(
ts
->
stdinfd
))
lxc_list_del
(
&
ts
->
node
);
free
(
ts
);
}
...
...
@@ -1065,14 +1033,12 @@ int lxc_console(struct lxc_container *c, int ttynum,
goto
close_fds
;
}
ts
->
escape
=
escape
;
ts
->
winch_proxy
=
c
->
name
;
ts
->
winch_proxy_lxcpath
=
c
->
config_path
;
ts
->
stdoutfd
=
stdoutfd
;
istty
=
isatty
(
stdinfd
);
if
(
istty
)
{
lxc_terminal_winsz
(
stdinfd
,
masterfd
);
lxc_
cmd_terminal_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
lxc_
terminal_winsz
(
ts
->
stdinfd
,
ts
->
masterfd
);
}
else
{
INFO
(
"File descriptor %d does not refer to a terminal"
,
stdinfd
);
}
...
...
src/lxc/terminal.h
View file @
b3db9f63
...
...
@@ -68,12 +68,6 @@ struct lxc_terminal_state {
*/
int
saw_escape
;
/* Name of the container to forward the SIGWINCH event to. */
const
char
*
winch_proxy
;
/* Path of the container to forward the SIGWINCH event to. */
const
char
*
winch_proxy_lxcpath
;
/* File descriptor that accepts signals. If set to -1 no signal handler
* could be installed. This also means that the sigset_t oldmask member
* is meaningless.
...
...
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