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
548029fa
Unverified
Commit
548029fa
authored
Feb 27, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
console: lxc_terminal_create()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
43366ca2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
console.c
src/lxc/console.c
+1
-1
console.h
src/lxc/console.h
+4
-4
start.c
src/lxc/start.c
+2
-2
No files found.
src/lxc/console.c
View file @
548029fa
...
...
@@ -874,7 +874,7 @@ err:
return
-
ENODEV
;
}
int
lxc_
console
_create
(
struct
lxc_conf
*
conf
)
int
lxc_
terminal
_create
(
struct
lxc_conf
*
conf
)
{
int
ret
;
struct
lxc_pty
*
console
=
&
conf
->
console
;
...
...
src/lxc/console.h
View file @
548029fa
...
...
@@ -85,15 +85,15 @@ extern int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttynum
extern
int
lxc_pty_create
(
struct
lxc_pty
*
console
);
/**
* lxc_
console
_create: Create a new pty.
* lxc_
terminal
_create: Create a new pty.
* - In addition to lxc_pty_create() also sets up all pty logs.
*/
extern
int
lxc_
console
_create
(
struct
lxc_conf
*
);
extern
int
lxc_
terminal
_create
(
struct
lxc_conf
*
);
/*
* Delete a pty created via lxc_
console
_create():
* Delete a pty created via lxc_
terminal
_create():
* - set old terminal settings
* - memory allocated via lxc_
console
_create() is free()ed.
* - memory allocated via lxc_
terminal
_create() is free()ed.
* - close master/slave pty pair and allocated fd for the peer (usually
* /dev/tty)
* Registered handlers in a mainloop are not automatically deleted.
...
...
src/lxc/start.c
View file @
548029fa
...
...
@@ -804,7 +804,7 @@ int lxc_init(const char *name, struct lxc_handler *handler)
TRACE
(
"Set up signal fd"
);
/* Do this after setting up signals since it might unblock SIGWINCH. */
ret
=
lxc_
console
_create
(
conf
);
ret
=
lxc_
terminal
_create
(
conf
);
if
(
ret
<
0
)
{
ERROR
(
"Failed to create console"
);
goto
out_restore_sigmask
;
...
...
@@ -1198,7 +1198,7 @@ static int do_start(void *data)
/* Some init's such as busybox will set sane tty settings on stdin,
* stdout, stderr which it thinks is the console. We already set them
* the way we wanted on the real terminal, and we want init to do its
* setup on its console ie. the pty allocated in lxc_
console
_create() so
* setup on its console ie. the pty allocated in lxc_
terminal
_create() so
* make sure that that pty is stdin,stdout,stderr.
*/
if
(
handler
->
conf
->
console
.
slave
>=
0
)
{
...
...
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