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
586bd38c
Unverified
Commit
586bd38c
authored
Feb 18, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: use wait_for_pid()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
96ef603b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lxccontainer.c
src/lxc/lxccontainer.c
+6
-7
No files found.
src/lxc/lxccontainer.c
View file @
586bd38c
...
@@ -718,7 +718,7 @@ again:
...
@@ -718,7 +718,7 @@ again:
static
bool
wait_on_daemonized_start
(
struct
lxc_handler
*
handler
,
int
pid
)
static
bool
wait_on_daemonized_start
(
struct
lxc_handler
*
handler
,
int
pid
)
{
{
int
state
,
status
;
int
ret
,
state
;
/* Close write end of the socket pair. */
/* Close write end of the socket pair. */
close
(
handler
->
state_socket_pair
[
1
]);
close
(
handler
->
state_socket_pair
[
1
]);
...
@@ -733,12 +733,11 @@ static bool wait_on_daemonized_start(struct lxc_handler *handler, int pid)
...
@@ -733,12 +733,11 @@ static bool wait_on_daemonized_start(struct lxc_handler *handler, int pid)
/* The first child is going to fork() again and then exits. So we reap
/* The first child is going to fork() again and then exits. So we reap
* the first child here.
* the first child here.
*/
*/
if
(
waitpid
(
pid
,
&
status
,
0
)
<
0
)
ret
=
wait_for_pid
(
pid
);
DEBUG
(
"Failed waiting on first child"
);
if
(
ret
<
0
)
else
if
(
!
WIFEXITED
(
status
))
DEBUG
(
"Failed waiting on first child %d"
,
pid
);
DEBUG
(
"Failed to retrieve exit status of first child"
);
else
else
if
(
WEXITSTATUS
(
status
)
!=
0
)
DEBUG
(
"First child %d exited"
,
pid
);
DEBUG
(
"First child exited with: %d"
,
WEXITSTATUS
(
status
));
if
(
state
<
0
)
{
if
(
state
<
0
)
{
SYSERROR
(
"Failed to receive the container state"
);
SYSERROR
(
"Failed to receive the container state"
);
...
...
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