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
57545890
Commit
57545890
authored
Nov 04, 2008
by
dlezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Exit instead of returning in child process. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
5f8dbb64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
start.c
src/lxc/start.c
+6
-5
No files found.
src/lxc/start.c
View file @
57545890
...
@@ -109,13 +109,13 @@ int lxc_start(const char *name, int argc, char *argv[],
...
@@ -109,13 +109,13 @@ int lxc_start(const char *name, int argc, char *argv[],
/* Tell our father he can begin to configure the container */
/* Tell our father he can begin to configure the container */
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
{
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
{
lxc_log_syserror
(
"failed to write socket"
);
lxc_log_syserror
(
"failed to write socket"
);
return
1
;
goto
out_child
;
}
}
/* Wait for the father to finish the configuration */
/* Wait for the father to finish the configuration */
if
(
read
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
{
if
(
read
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
{
lxc_log_syserror
(
"failed to read socket"
);
lxc_log_syserror
(
"failed to read socket"
);
return
1
;
goto
out_child
;
}
}
/* Setup the container, ip, names, utsname, ... */
/* Setup the container, ip, names, utsname, ... */
...
@@ -123,19 +123,19 @@ int lxc_start(const char *name, int argc, char *argv[],
...
@@ -123,19 +123,19 @@ int lxc_start(const char *name, int argc, char *argv[],
lxc_log_error
(
"failed to setup the container"
);
lxc_log_error
(
"failed to setup the container"
);
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
lxc_log_syserror
(
"failed to write the socket"
);
lxc_log_syserror
(
"failed to write the socket"
);
return
-
1
;
goto
out_child
;
}
}
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
;
goto
out_child
;
}
}
/* If a callback has been passed, call it before doing exec */
/* If a callback has been passed, call it before doing exec */
if
(
prestart
)
if
(
prestart
)
if
(
prestart
(
name
,
argc
,
argv
,
data
))
{
if
(
prestart
(
name
,
argc
,
argv
,
data
))
{
lxc_log_error
(
"prestart callback has failed"
);
lxc_log_error
(
"prestart callback has failed"
);
return
-
1
;
goto
out_child
;
}
}
execvp
(
argv
[
0
],
argv
);
execvp
(
argv
[
0
],
argv
);
...
@@ -145,6 +145,7 @@ int lxc_start(const char *name, int argc, char *argv[],
...
@@ -145,6 +145,7 @@ int lxc_start(const char *name, int argc, char *argv[],
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
lxc_log_syserror
(
"failed to write the socket"
);
lxc_log_syserror
(
"failed to write the socket"
);
out_child:
exit
(
1
);
exit
(
1
);
}
}
...
...
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