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
e5ab821d
Commit
e5ab821d
authored
Mar 06, 2014
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix console stdin,stdout,stderr fds"
This reverts commit
1da0ad1e
.
parent
3afbcc46
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
27 deletions
+4
-27
console.c
src/lxc/console.c
+1
-17
console.h
src/lxc/console.h
+0
-1
lxc_console.c
src/lxc/lxc_console.c
+1
-0
lxc_start.c
src/lxc/lxc_start.c
+1
-0
start.c
src/lxc/start.c
+1
-9
No files found.
src/lxc/console.c
View file @
e5ab821d
...
@@ -506,7 +506,7 @@ static void lxc_console_peer_default(struct lxc_console *console)
...
@@ -506,7 +506,7 @@ static void lxc_console_peer_default(struct lxc_console *console)
DEBUG
(
"using '%s' as console"
,
path
);
DEBUG
(
"using '%s' as console"
,
path
);
if
(
!
isatty
(
console
->
peer
))
if
(
!
isatty
(
console
->
peer
))
goto
err1
;
return
;
ts
=
lxc_console_sigwinch_init
(
console
->
peer
,
console
->
master
);
ts
=
lxc_console_sigwinch_init
(
console
->
peer
,
console
->
master
);
if
(
!
ts
)
if
(
!
ts
)
...
@@ -611,23 +611,7 @@ err:
...
@@ -611,23 +611,7 @@ err:
return
-
1
;
return
-
1
;
}
}
int
lxc_console_set_stdfds
(
struct
lxc_handler
*
handler
)
{
struct
lxc_conf
*
conf
=
handler
->
conf
;
struct
lxc_console
*
console
=
&
conf
->
console
;
if
(
console
->
slave
<
0
)
return
0
;
if
(
dup2
(
console
->
slave
,
0
)
<
0
||
dup2
(
console
->
slave
,
1
)
<
0
||
dup2
(
console
->
slave
,
2
)
<
0
)
{
SYSERROR
(
"failed to dup console"
);
return
-
1
;
}
return
0
;
}
static
int
lxc_console_cb_tty_stdin
(
int
fd
,
uint32_t
events
,
void
*
cbdata
,
static
int
lxc_console_cb_tty_stdin
(
int
fd
,
uint32_t
events
,
void
*
cbdata
,
struct
lxc_epoll_descr
*
descr
)
struct
lxc_epoll_descr
*
descr
)
...
...
src/lxc/console.h
View file @
e5ab821d
...
@@ -36,4 +36,3 @@ extern int lxc_console(struct lxc_container *c, int ttynum,
...
@@ -36,4 +36,3 @@ extern int lxc_console(struct lxc_container *c, int ttynum,
int
escape
);
int
escape
);
extern
int
lxc_console_getfd
(
struct
lxc_container
*
c
,
int
*
ttynum
,
extern
int
lxc_console_getfd
(
struct
lxc_container
*
c
,
int
*
ttynum
,
int
*
masterfd
);
int
*
masterfd
);
extern
int
lxc_console_set_stdfds
(
struct
lxc_handler
*
);
src/lxc/lxc_console.c
View file @
e5ab821d
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <errno.h>
#include <errno.h>
#include <string.h>
#include <string.h>
#include <fcntl.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <unistd.h>
#include <signal.h>
#include <signal.h>
#include <libgen.h>
#include <libgen.h>
...
...
src/lxc/lxc_start.c
View file @
e5ab821d
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#include <termios.h>
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <fcntl.h>
#include <signal.h>
#include <signal.h>
...
...
src/lxc/start.c
View file @
e5ab821d
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <unistd.h>
#include <unistd.h>
#include <signal.h>
#include <signal.h>
#include <fcntl.h>
#include <fcntl.h>
#include <termios.h>
#include <grp.h>
#include <grp.h>
#include <poll.h>
#include <poll.h>
#include <sys/param.h>
#include <sys/param.h>
...
@@ -725,15 +726,6 @@ static int do_start(void *data)
...
@@ -725,15 +726,6 @@ static int do_start(void *data)
goto
out_warn_father
;
goto
out_warn_father
;
}
}
/* 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 make sure that that pty is stdin,stdout,stderr.
*/
if
(
lxc_console_set_stdfds
(
handler
)
<
0
)
goto
out_warn_father
;
close
(
handler
->
sigfd
);
close
(
handler
->
sigfd
);
/* after this call, we are in error because this
/* after this call, we are in error because this
...
...
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