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
28c42dfc
Unverified
Commit
28c42dfc
authored
Nov 20, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
33903369
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
lxccontainer.c
src/lxc/lxccontainer.c
+14
-12
No files found.
src/lxc/lxccontainer.c
View file @
28c42dfc
...
...
@@ -771,6 +771,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
NULL
,
};
char
**
init_cmd
=
NULL
;
int
keepfds
[
3
]
=
{
-
1
,
-
1
,
-
1
};
/* container does exist */
if
(
!
c
)
...
...
@@ -891,11 +892,11 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
exit
(
EXIT_FAILURE
);
}
ret
=
lxc_check_inherited
(
conf
,
true
,
(
int
[]){
handler
->
conf
->
maincmd_fd
,
handler
->
state_socket_pair
[
0
],
handler
->
state_socket_pair
[
1
]}
,
3
);
keepfds
[
0
]
=
handler
->
conf
->
maincmd_fd
;
keepfds
[
1
]
=
handler
->
state_socket_pair
[
0
];
keepfds
[
2
]
=
handler
->
state_socket_pair
[
1
];
ret
=
lxc_check_inherited
(
conf
,
true
,
keepfds
,
sizeof
(
keepfds
)
/
sizeof
(
keepfds
[
0
])
);
if
(
ret
<
0
)
exit
(
EXIT_FAILURE
);
...
...
@@ -980,11 +981,11 @@ reboot:
}
}
ret
=
lxc_check_inherited
(
conf
,
daemonize
,
(
int
[]){
handler
->
conf
->
maincmd_fd
,
handler
->
state_socket_pair
[
0
],
handler
->
state_socket_pair
[
1
]}
,
3
);
keepfds
[
0
]
=
handler
->
conf
->
maincmd_fd
;
keepfds
[
1
]
=
handler
->
state_socket_pair
[
0
];
keepfds
[
2
]
=
handler
->
state_socket_pair
[
1
];
ret
=
lxc_check_inherited
(
conf
,
daemonize
,
keepfds
,
sizeof
(
keepfds
)
/
sizeof
(
keepfds
[
0
])
);
if
(
ret
<
0
)
{
lxc_free_handler
(
handler
);
ret
=
1
;
...
...
@@ -1745,7 +1746,7 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout)
if
(
c
->
lxc_conf
&&
c
->
lxc_conf
->
haltsignal
)
haltsignal
=
c
->
lxc_conf
->
haltsignal
;
INFO
(
"Using signal number '%d' as halt signal
.
"
,
haltsignal
);
INFO
(
"Using signal number '%d' as halt signal"
,
haltsignal
);
/* Add a new state client before sending the shutdown signal so that we
* don't miss a state.
...
...
@@ -1756,13 +1757,14 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout)
/* Send shutdown signal to container. */
if
(
kill
(
pid
,
haltsignal
)
<
0
)
WARN
(
"Could not send signal %d to pid %d
.
"
,
haltsignal
,
pid
);
WARN
(
"Could not send signal %d to pid %d"
,
haltsignal
,
pid
);
/* Retrieve the state. */
if
(
state_client_fd
>=
0
)
{
int
state
;
state
=
lxc_cmd_sock_rcv_state
(
state_client_fd
,
timeout
);
close
(
state_client_fd
);
TRACE
(
"Received state
\"
%s
\"
"
,
lxc_state2str
(
state
));
if
(
state
!=
STOPPED
)
return
false
;
retv
=
true
;
...
...
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