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
4fcc0112
Commit
4fcc0112
authored
May 28, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create the container with an empty configuration
Fix the code to not fail when the specified configuration file is empty. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
6203de18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
lxc_create.c
src/lxc/lxc_create.c
+22
-2
parse.c
src/lxc/parse.c
+1
-1
No files found.
src/lxc/lxc_create.c
View file @
4fcc0112
...
...
@@ -35,6 +35,8 @@
#include "confile.h"
#include "arguments.h"
lxc_log_define
(
lxc_create
,
lxc
);
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
{
switch
(
c
)
{
...
...
@@ -63,6 +65,11 @@ Options :\n\
.
checker
=
NULL
,
};
static
int
copy_config_file
(
const
char
*
name
,
const
char
*
file
)
{
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
struct
lxc_conf
lxc_conf
;
...
...
@@ -79,9 +86,22 @@ int main(int argc, char *argv[])
if
(
lxc_conf_init
(
&
lxc_conf
))
return
-
1
;
if
(
my_args
.
rcfile
&&
lxc_config_read
(
my_args
.
rcfile
,
&
lxc_conf
))
if
(
my_args
.
rcfile
&&
lxc_config_read
(
my_args
.
rcfile
,
&
lxc_conf
))
{
ERROR
(
"failed to read the configuration file"
);
return
-
1
;
}
return
lxc_create
(
my_args
.
name
,
&
lxc_conf
);
if
(
lxc_create
(
my_args
.
name
,
&
lxc_conf
))
{
ERROR
(
"failed to create the container"
);
return
-
1
;
}
if
(
copy_config_file
(
my_args
.
name
,
my_args
.
rcfile
))
{
ERROR
(
"failed to copy the configuration file"
);
lxc_destroy
(
my_args
.
name
);
return
-
1
;
}
return
0
;
}
src/lxc/parse.c
View file @
4fcc0112
...
...
@@ -67,7 +67,7 @@ int lxc_file_for_each_line(const char *file, lxc_file_cb callback,
char
*
buffer
,
size_t
len
,
void
*
data
)
{
FILE
*
f
;
int
err
=
-
1
;
int
err
=
0
;
f
=
fopen
(
file
,
"r"
);
if
(
!
f
)
{
...
...
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