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
536b97f0
Commit
536b97f0
authored
Oct 08, 2008
by
dlezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed useless opentty function and moved the sighandler restore to the right place
parent
69437d52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
33 deletions
+2
-33
start.c
src/lxc/start.c
+2
-33
No files found.
src/lxc/start.c
View file @
536b97f0
...
@@ -42,31 +42,6 @@
...
@@ -42,31 +42,6 @@
LXC_TTY_HANDLER
(
SIGINT
);
LXC_TTY_HANDLER
(
SIGINT
);
LXC_TTY_HANDLER
(
SIGQUIT
);
LXC_TTY_HANDLER
(
SIGQUIT
);
int
opentty
(
const
char
*
ttyname
)
{
int
i
,
fd
,
flags
;
fd
=
open
(
ttyname
,
O_RDWR
|
O_NONBLOCK
);
if
(
fd
==
-
1
)
{
lxc_log_syserror
(
"open '%s'"
,
ttyname
);
return
-
1
;
}
flags
=
fcntl
(
fd
,
F_GETFL
);
flags
&=
~
O_NONBLOCK
;
fcntl
(
fd
,
F_SETFL
,
flags
);
for
(
i
=
0
;
i
<
fd
;
i
++
)
close
(
i
);
for
(
i
=
0
;
i
<
3
;
i
++
)
if
(
fd
!=
i
)
dup2
(
fd
,
i
);
if
(
fd
>=
3
)
close
(
fd
);
return
0
;
}
int
lxc_start
(
const
char
*
name
,
int
argc
,
char
*
argv
[],
int
lxc_start
(
const
char
*
name
,
int
argc
,
char
*
argv
[],
lxc_callback_t
prestart
,
void
*
data
)
lxc_callback_t
prestart
,
void
*
data
)
{
{
...
@@ -151,12 +126,6 @@ int lxc_start(const char *name, int argc, char *argv[],
...
@@ -151,12 +126,6 @@ int lxc_start(const char *name, int argc, char *argv[],
return
-
1
;
return
-
1
;
}
}
/* Open the tty */
if
(
opentty
(
ttyname
))
{
lxc_log_syserror
(
"failed to open the tty"
);
return
-
1
;
}
if
(
mount
(
ttyname
,
"/dev/console"
,
"none"
,
MS_BIND
,
0
))
{
if
(
mount
(
ttyname
,
"/dev/console"
,
"none"
,
MS_BIND
,
0
))
{
lxc_log_syserror
(
"failed to mount '/dev/console'"
);
lxc_log_syserror
(
"failed to mount '/dev/console'"
);
return
-
1
;
return
-
1
;
...
@@ -262,6 +231,8 @@ out:
...
@@ -262,6 +231,8 @@ out:
unlink
(
init
);
unlink
(
init
);
free
(
val
);
free
(
val
);
lxc_put_lock
(
lock
);
lxc_put_lock
(
lock
);
LXC_TTY_DEL_HANDLER
(
SIGQUIT
);
LXC_TTY_DEL_HANDLER
(
SIGINT
);
return
err
;
return
err
;
...
@@ -282,8 +253,6 @@ err_waitpid_failed:
...
@@ -282,8 +253,6 @@ err_waitpid_failed:
kill
(
pid
,
SIGKILL
);
kill
(
pid
,
SIGKILL
);
err_fork_ns:
err_fork_ns:
LXC_TTY_DEL_HANDLER
(
SIGQUIT
);
LXC_TTY_DEL_HANDLER
(
SIGINT
);
close
(
sv
[
0
]);
close
(
sv
[
0
]);
close
(
sv
[
1
]);
close
(
sv
[
1
]);
goto
out
;
goto
out
;
...
...
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