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
373376b2
Unverified
Commit
373376b2
authored
Oct 08, 2018
by
Stéphane Graber
Committed by
GitHub
Oct 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2682 from brauner/2018-10-08/fix_config_parsing
parse: do not mask failed parse
parents
27ebf8a1
646e6c8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
parse.c
src/lxc/parse.c
+4
-2
get_item.c
src/tests/get_item.c
+6
-0
parse_config_file.c
src/tests/parse_config_file.c
+5
-0
No files found.
src/lxc/parse.c
View file @
373376b2
...
...
@@ -111,9 +111,11 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, void *da
}
on_error:
ret
=
lxc_strmunmap
(
buf
,
st
.
st_size
);
if
(
ret
<
0
)
if
(
lxc_strmunmap
(
buf
,
st
.
st_size
)
<
0
)
{
SYSERROR
(
"Failed to unmap config file
\"
%s
\"
"
,
file
);
if
(
ret
==
0
)
ret
=
-
1
;
}
saved_errno
=
errno
;
close
(
fd
);
...
...
src/tests/get_item.c
View file @
373376b2
...
...
@@ -600,6 +600,12 @@ int main(int argc, char *argv[])
goto
out
;
}
if
(
c
->
set_config_item
(
c
,
"lxc.notaconfigkey"
,
"invalid"
))
{
fprintf
(
stderr
,
"%d: Managed to set
\"
lxc.notaconfigkey
\"\n
"
,
__LINE__
);
goto
out
;
}
printf
(
"All get_item tests passed
\n
"
);
fret
=
EXIT_SUCCESS
;
...
...
src/tests/parse_config_file.c
View file @
373376b2
...
...
@@ -778,6 +778,11 @@ int main(int argc, char *argv[])
goto
non_test_error
;
}
if
(
c
->
set_config_item
(
c
,
"lxc.notaconfigkey"
,
"invalid"
))
{
lxc_error
(
"%s
\n
"
,
"Managed to set to set invalid config item
\"
lxc.notaconfigkey
\"
to
\"
invalid
\"
"
);
return
-
1
;
}
fret
=
EXIT_SUCCESS
;
non_test_error:
...
...
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