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
89f59fa2
Unverified
Commit
89f59fa2
authored
May 17, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: cleanup attach functions
Specifically, refloat function arguments and remove useless comments. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b748fa8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
lxccontainer.c
src/lxc/lxccontainer.c
+18
-12
No files found.
src/lxc/lxccontainer.c
View file @
89f59fa2
...
@@ -4014,7 +4014,9 @@ static bool do_lxcapi_rename(struct lxc_container *c, const char *newname)
...
@@ -4014,7 +4014,9 @@ static bool do_lxcapi_rename(struct lxc_container *c, const char *newname)
WRAP_API_1
(
bool
,
lxcapi_rename
,
const
char
*
)
WRAP_API_1
(
bool
,
lxcapi_rename
,
const
char
*
)
static
int
lxcapi_attach
(
struct
lxc_container
*
c
,
lxc_attach_exec_t
exec_function
,
void
*
exec_payload
,
lxc_attach_options_t
*
options
,
pid_t
*
attached_process
)
static
int
lxcapi_attach
(
struct
lxc_container
*
c
,
lxc_attach_exec_t
exec_function
,
void
*
exec_payload
,
lxc_attach_options_t
*
options
,
pid_t
*
attached_process
)
{
{
int
ret
;
int
ret
;
...
@@ -4023,33 +4025,37 @@ static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_functio
...
@@ -4023,33 +4025,37 @@ static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_functio
current_config
=
c
->
lxc_conf
;
current_config
=
c
->
lxc_conf
;
ret
=
lxc_attach
(
c
,
exec_function
,
exec_payload
,
options
,
attached_process
);
ret
=
lxc_attach
(
c
,
exec_function
,
exec_payload
,
options
,
attached_process
);
current_config
=
NULL
;
current_config
=
NULL
;
return
ret
;
return
ret
;
}
}
static
int
do_lxcapi_attach_run_wait
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
,
const
char
*
program
,
const
char
*
const
argv
[])
static
int
do_lxcapi_attach_run_wait
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
,
const
char
*
program
,
const
char
*
const
argv
[])
{
{
lxc_attach_command_t
command
;
lxc_attach_command_t
command
;
pid_t
pid
;
pid_t
pid
;
int
r
;
int
r
et
;
if
(
!
c
)
if
(
!
c
)
return
-
1
;
return
-
1
;
command
.
program
=
(
char
*
)
program
;
command
.
program
=
(
char
*
)
program
;
command
.
argv
=
(
char
**
)
argv
;
command
.
argv
=
(
char
**
)
argv
;
r
=
lxc_attach
(
c
,
lxc_attach_run_command
,
&
command
,
options
,
&
pid
);
ret
=
lxc_attach
(
c
,
lxc_attach_run_command
,
&
command
,
options
,
&
pid
);
if
(
r
<
0
)
{
if
(
ret
<
0
)
ERROR
(
"ups"
);
return
ret
;
return
r
;
}
return
lxc_wait_for_pid_status
(
pid
);
return
lxc_wait_for_pid_status
(
pid
);
}
}
static
int
lxcapi_attach_run_wait
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
,
const
char
*
program
,
const
char
*
const
argv
[])
static
int
lxcapi_attach_run_wait
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
,
const
char
*
program
,
const
char
*
const
argv
[])
{
{
int
ret
;
int
ret
;
...
...
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