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
b5248399
Unverified
Commit
b5248399
authored
Feb 13, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: convert to strequal()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
94c0fbad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
conf.c
src/lxc/conf.c
+9
-9
No files found.
src/lxc/conf.c
View file @
b5248399
...
...
@@ -1840,7 +1840,7 @@ static int parse_mntopt(char *opt, unsigned long *flags, char **data, size_t siz
for
(
struct
mount_opt
*
mo
=
&
mount_opt
[
0
];
mo
->
name
!=
NULL
;
mo
++
)
{
size_t
mo_name_len
=
strlen
(
mo
->
name
);
if
(
opt_len
==
mo_name_len
&&
strn
cmp
(
opt
,
mo
->
name
,
mo_name_len
)
==
0
)
{
if
(
opt_len
==
mo_name_len
&&
strn
equal
(
opt
,
mo
->
name
,
mo_name_len
)
)
{
if
(
mo
->
clear
)
*
flags
&=
~
mo
->
flag
;
else
...
...
@@ -1900,7 +1900,7 @@ static void parse_propagationopt(char *opt, unsigned long *flags)
/* If opt is found in propagation_opt, set or clear flags. */
for
(
mo
=
&
propagation_opt
[
0
];
mo
->
name
!=
NULL
;
mo
++
)
{
if
(
strncmp
(
opt
,
mo
->
name
,
strlen
(
mo
->
name
))
!=
0
)
if
(
!
strnequal
(
opt
,
mo
->
name
,
strlen
(
mo
->
name
))
)
continue
;
if
(
mo
->
clear
)
...
...
@@ -2097,7 +2097,7 @@ static int mount_entry_create_dir_file(const struct mntent *mntent,
int
ret
;
char
*
p2
;
if
(
strn
cmp
(
mntent
->
mnt_type
,
"overlay"
,
7
)
==
0
)
{
if
(
strn
equal
(
mntent
->
mnt_type
,
"overlay"
,
7
)
)
{
ret
=
ovl_mkdir
(
mntent
,
rootfs
,
lxc_name
,
lxc_path
);
if
(
ret
<
0
)
return
-
1
;
...
...
@@ -3666,7 +3666,7 @@ int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version)
if
(
strequal
(
key
,
global_token
))
all
=
true
;
else
if
(
strn
cmp
(
key
,
namespaced_token
,
namespaced_token_len
)
==
0
)
else
if
(
strn
equal
(
key
,
namespaced_token
,
namespaced_token_len
)
)
k
+=
namespaced_token_len
;
else
return
-
EINVAL
;
...
...
@@ -3706,9 +3706,9 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
if
(
strequal
(
key
,
"lxc.limit"
)
||
strequal
(
key
,
"lxc.prlimit"
))
all
=
true
;
else
if
(
strn
cmp
(
key
,
"lxc.limit."
,
STRLITERALLEN
(
"lxc.limit."
))
==
0
)
else
if
(
strn
equal
(
key
,
"lxc.limit."
,
STRLITERALLEN
(
"lxc.limit."
))
)
k
=
key
+
STRLITERALLEN
(
"lxc.limit."
);
else
if
(
strn
cmp
(
key
,
"lxc.prlimit."
,
STRLITERALLEN
(
"lxc.prlimit."
))
==
0
)
else
if
(
strn
equal
(
key
,
"lxc.prlimit."
,
STRLITERALLEN
(
"lxc.prlimit."
))
)
k
=
key
+
STRLITERALLEN
(
"lxc.prlimit."
);
else
return
-
1
;
...
...
@@ -3736,7 +3736,7 @@ int lxc_clear_sysctls(struct lxc_conf *c, const char *key)
if
(
strequal
(
key
,
"lxc.sysctl"
))
all
=
true
;
else
if
(
strn
cmp
(
key
,
"lxc.sysctl."
,
STRLITERALLEN
(
"lxc.sysctl."
))
==
0
)
else
if
(
strn
equal
(
key
,
"lxc.sysctl."
,
STRLITERALLEN
(
"lxc.sysctl."
))
)
k
=
key
+
STRLITERALLEN
(
"lxc.sysctl."
);
else
return
-
1
;
...
...
@@ -3765,7 +3765,7 @@ int lxc_clear_procs(struct lxc_conf *c, const char *key)
if
(
strequal
(
key
,
"lxc.proc"
))
all
=
true
;
else
if
(
strn
cmp
(
key
,
"lxc.proc."
,
STRLITERALLEN
(
"lxc.proc."
))
==
0
)
else
if
(
strn
equal
(
key
,
"lxc.proc."
,
STRLITERALLEN
(
"lxc.proc."
))
)
k
=
key
+
STRLITERALLEN
(
"lxc.proc."
);
else
return
-
1
;
...
...
@@ -3840,7 +3840,7 @@ int lxc_clear_hooks(struct lxc_conf *c, const char *key)
if
(
strequal
(
key
,
"lxc.hook"
))
all
=
true
;
else
if
(
strn
cmp
(
key
,
"lxc.hook."
,
STRLITERALLEN
(
"lxc.hook."
))
==
0
)
else
if
(
strn
equal
(
key
,
"lxc.hook."
,
STRLITERALLEN
(
"lxc.hook."
))
)
k
=
key
+
STRLITERALLEN
(
"lxc.hook."
);
else
return
-
1
;
...
...
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