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
060adc61
Unverified
Commit
060adc61
authored
Jan 12, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: do not call close() on invalid fd
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dc5f6125
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
lxc-test-utils.c
src/tests/lxc-test-utils.c
+2
-12
No files found.
src/tests/lxc-test-utils.c
View file @
060adc61
...
@@ -180,6 +180,7 @@ void test_detect_ramfs_rootfs(void)
...
@@ -180,6 +180,7 @@ void test_detect_ramfs_rootfs(void)
}
}
fclose
(
fp1
);
fclose
(
fp1
);
fp1
=
NULL
;
fp1
=
NULL
;
fd1
=
-
1
;
/* Test if it correctly fails to detect when no - rootfs rootfs */
/* Test if it correctly fails to detect when no - rootfs rootfs */
for
(
i
=
0
;
i
<
sizeof
(
mountinfo
)
/
sizeof
(
mountinfo
[
0
]);
i
++
)
{
for
(
i
=
0
;
i
<
sizeof
(
mountinfo
)
/
sizeof
(
mountinfo
[
0
]);
i
++
)
{
...
@@ -192,6 +193,7 @@ void test_detect_ramfs_rootfs(void)
...
@@ -192,6 +193,7 @@ void test_detect_ramfs_rootfs(void)
}
}
fclose
(
fp2
);
fclose
(
fp2
);
fp2
=
NULL
;
fp2
=
NULL
;
fd2
=
-
1
;
if
(
mount
(
tmpf1
,
"/proc/self/mountinfo"
,
NULL
,
MS_BIND
,
0
)
<
0
)
{
if
(
mount
(
tmpf1
,
"/proc/self/mountinfo"
,
NULL
,
MS_BIND
,
0
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"Could not overmount
\"
/proc/self/mountinfo
\"
."
);
lxc_error
(
"%s
\n
"
,
"Could not overmount
\"
/proc/self/mountinfo
\"
."
);
...
@@ -419,12 +421,6 @@ void test_parse_byte_size_string(void)
...
@@ -419,12 +421,6 @@ void test_parse_byte_size_string(void)
if
(
n
!=
1048576
)
if
(
n
!=
1048576
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
ret
=
parse_byte_size_string
(
"1GB"
,
&
n
);
if
(
ret
<
0
)
exit
(
EXIT_FAILURE
);
if
(
n
!=
1073741824
)
exit
(
EXIT_FAILURE
);
ret
=
parse_byte_size_string
(
"1TB"
,
&
n
);
ret
=
parse_byte_size_string
(
"1TB"
,
&
n
);
if
(
ret
==
0
)
if
(
ret
==
0
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -447,12 +443,6 @@ void test_parse_byte_size_string(void)
...
@@ -447,12 +443,6 @@ void test_parse_byte_size_string(void)
if
(
n
!=
1048576
)
if
(
n
!=
1048576
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
ret
=
parse_byte_size_string
(
"1 GB"
,
&
n
);
if
(
ret
<
0
)
exit
(
EXIT_FAILURE
);
if
(
n
!=
1073741824
)
exit
(
EXIT_FAILURE
);
ret
=
parse_byte_size_string
(
"1 TB"
,
&
n
);
ret
=
parse_byte_size_string
(
"1 TB"
,
&
n
);
if
(
ret
==
0
)
if
(
ret
==
0
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
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