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
af06a4bf
Commit
af06a4bf
authored
Jul 15, 2009
by
Daniel Lezcano
Committed by
Daniel Lezcano
Jul 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the lxc arguments dup in lxc_execute
Now we have a helper to dup the arguments, let's use it. The code gains in clarity. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
fa7eddbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
27 deletions
+2
-27
lxc_execute.c
src/lxc/lxc_execute.c
+2
-27
No files found.
src/lxc/lxc_execute.c
View file @
af06a4bf
...
...
@@ -79,8 +79,6 @@ int main(int argc, char *argv[])
{
static
char
**
args
;
char
path
[
MAXPATHLEN
];
int
opt
;
int
nbargs
=
0
;
int
autodestroy
=
0
;
int
ret
=
-
1
;
struct
lxc_conf
lxc_conf
;
...
...
@@ -105,32 +103,9 @@ int main(int argc, char *argv[])
autodestroy
=
1
;
}
args
=
alloca
((
my_args
.
argc
+
3
)
*
sizeof
(
*
args
));
if
(
!
args
)
{
ERROR
(
"failed to allocate memory for '%s'"
,
my_args
.
name
);
args
=
lxc_arguments_dup
(
LXCLIBEXECDIR
"/lxc-init"
,
&
my_args
);
if
(
!
args
)
goto
out
;
}
nbargs
=
0
;
args
[
nbargs
++
]
=
LXCLIBEXECDIR
"/lxc-init"
;
if
(
my_args
.
log_file
)
{
args
[
nbargs
++
]
=
"--logfile"
;
args
[
nbargs
++
]
=
strdupa
(
my_args
.
log_file
);
}
if
(
my_args
.
log_priority
)
{
args
[
nbargs
++
]
=
"--logpriority"
;
args
[
nbargs
++
]
=
strdupa
(
my_args
.
log_priority
);
}
if
(
my_args
.
quiet
)
{
args
[
nbargs
++
]
=
"--quiet"
;
}
args
[
nbargs
++
]
=
"--"
;
for
(
opt
=
0
;
opt
<
my_args
.
argc
;
opt
++
)
args
[
nbargs
++
]
=
strdupa
(
my_args
.
argv
[
opt
]);
args
[
nbargs
]
=
'\0'
;
ret
=
lxc_start
(
my_args
.
name
,
args
);
out:
...
...
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