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
bba8123b
Unverified
Commit
bba8123b
authored
Feb 19, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start: lxc_init_handler()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
90f0753b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
start.c
src/lxc/start.c
+6
-9
No files found.
src/lxc/start.c
View file @
bba8123b
...
@@ -657,16 +657,13 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
...
@@ -657,16 +657,13 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
struct
lxc_handler
*
handler
;
struct
lxc_handler
*
handler
;
handler
=
malloc
(
sizeof
(
*
handler
));
handler
=
malloc
(
sizeof
(
*
handler
));
if
(
!
handler
)
{
if
(
!
handler
)
ERROR
(
"failed to allocate memory"
);
return
NULL
;
return
NULL
;
}
memset
(
handler
,
0
,
sizeof
(
*
handler
));
memset
(
handler
,
0
,
sizeof
(
*
handler
));
/* Note that am_guest_unpriv() checks the effective uid. We
probably don't
/* Note that am_guest_unpriv() checks the effective uid. We
*
care if we are real root only if we are running as root so this
*
probably don't care if we are real root only if we are running
* should be fine.
*
as root so this
should be fine.
*/
*/
handler
->
am_root
=
!
am_guest_unpriv
();
handler
->
am_root
=
!
am_guest_unpriv
();
handler
->
data_sock
[
0
]
=
handler
->
data_sock
[
1
]
=
-
1
;
handler
->
data_sock
[
0
]
=
handler
->
data_sock
[
1
]
=
-
1
;
...
@@ -685,8 +682,8 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
...
@@ -685,8 +682,8 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
if
(
daemonize
&&
!
handler
->
conf
->
reboot
)
{
if
(
daemonize
&&
!
handler
->
conf
->
reboot
)
{
/* Create socketpair() to synchronize on daemonized startup.
/* Create socketpair() to synchronize on daemonized startup.
* When the container reboots we don't need to synchronize
again
* When the container reboots we don't need to synchronize
* currently so don't open another socketpair().
*
again
currently so don't open another socketpair().
*/
*/
ret
=
socketpair
(
AF_UNIX
,
SOCK_STREAM
|
SOCK_CLOEXEC
,
0
,
ret
=
socketpair
(
AF_UNIX
,
SOCK_STREAM
|
SOCK_CLOEXEC
,
0
,
handler
->
state_socket_pair
);
handler
->
state_socket_pair
);
...
...
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