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
235f1815
Commit
235f1815
authored
Mar 05, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use strchr in place of index bc bionic
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
ccb4cabe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
cgfsng.c
src/lxc/cgfsng.c
+10
-10
No files found.
src/lxc/cgfsng.c
View file @
235f1815
...
@@ -368,7 +368,7 @@ static char **get_controllers(char **klist, char **nlist, char *line)
...
@@ -368,7 +368,7 @@ static char **get_controllers(char **klist, char **nlist, char *line)
char
**
aret
=
NULL
;
char
**
aret
=
NULL
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
p
=
index
(
p
,
' '
);
p
=
strchr
(
p
,
' '
);
if
(
!
p
)
if
(
!
p
)
return
NULL
;
return
NULL
;
p
++
;
p
++
;
...
@@ -380,7 +380,7 @@ static char **get_controllers(char **klist, char **nlist, char *line)
...
@@ -380,7 +380,7 @@ static char **get_controllers(char **klist, char **nlist, char *line)
if
(
strncmp
(
p
,
"/sys/fs/cgroup/"
,
15
)
!=
0
)
if
(
strncmp
(
p
,
"/sys/fs/cgroup/"
,
15
)
!=
0
)
return
NULL
;
return
NULL
;
p
+=
15
;
p
+=
15
;
p2
=
index
(
p
,
' '
);
p2
=
strchr
(
p
,
' '
);
if
(
!
p2
)
{
if
(
!
p2
)
{
ERROR
(
"corrupt mountinfo"
);
ERROR
(
"corrupt mountinfo"
);
return
NULL
;
return
NULL
;
...
@@ -431,7 +431,7 @@ static char *get_mountpoint(char *line)
...
@@ -431,7 +431,7 @@ static char *get_mountpoint(char *line)
size_t
len
;
size_t
len
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
p
=
index
(
p
,
' '
);
p
=
strchr
(
p
,
' '
);
if
(
!
p
)
if
(
!
p
)
return
NULL
;
return
NULL
;
p
++
;
p
++
;
...
@@ -450,7 +450,7 @@ static char *get_mountpoint(char *line)
...
@@ -450,7 +450,7 @@ static char *get_mountpoint(char *line)
*/
*/
static
char
*
copy_to_eol
(
char
*
p
)
static
char
*
copy_to_eol
(
char
*
p
)
{
{
char
*
p2
=
index
(
p
,
'\n'
),
*
sret
;
char
*
p2
=
strchr
(
p
,
'\n'
),
*
sret
;
size_t
len
;
size_t
len
;
if
(
!
p2
)
if
(
!
p2
)
...
@@ -473,7 +473,7 @@ static bool controller_in_clist(char *cgline, char *c)
...
@@ -473,7 +473,7 @@ static bool controller_in_clist(char *cgline, char *c)
char
*
tok
,
*
saveptr
=
NULL
,
*
eol
,
*
tmp
;
char
*
tok
,
*
saveptr
=
NULL
,
*
eol
,
*
tmp
;
size_t
len
;
size_t
len
;
eol
=
index
(
cgline
,
':'
);
eol
=
strchr
(
cgline
,
':'
);
if
(
!
eol
)
if
(
!
eol
)
return
false
;
return
false
;
...
@@ -499,19 +499,19 @@ static char *get_current_cgroup(char *basecginfo, char *controller)
...
@@ -499,19 +499,19 @@ static char *get_current_cgroup(char *basecginfo, char *controller)
char
*
p
=
basecginfo
;
char
*
p
=
basecginfo
;
while
(
1
)
{
while
(
1
)
{
p
=
index
(
p
,
':'
);
p
=
strchr
(
p
,
':'
);
if
(
!
p
)
if
(
!
p
)
return
NULL
;
return
NULL
;
p
++
;
p
++
;
if
(
controller_in_clist
(
p
,
controller
))
{
if
(
controller_in_clist
(
p
,
controller
))
{
p
=
index
(
p
,
':'
);
p
=
strchr
(
p
,
':'
);
if
(
!
p
)
if
(
!
p
)
return
NULL
;
return
NULL
;
p
++
;
p
++
;
return
copy_to_eol
(
p
);
return
copy_to_eol
(
p
);
}
}
p
=
index
(
p
,
'\n'
);
p
=
strchr
(
p
,
'\n'
);
if
(
!
p
)
if
(
!
p
)
return
NULL
;
return
NULL
;
p
++
;
p
++
;
...
@@ -581,11 +581,11 @@ static void get_existing_subsystems(char ***klist, char ***nlist)
...
@@ -581,11 +581,11 @@ static void get_existing_subsystems(char ***klist, char ***nlist)
return
;
return
;
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
char
*
p
,
*
p2
,
*
tok
,
*
saveptr
=
NULL
;
char
*
p
,
*
p2
,
*
tok
,
*
saveptr
=
NULL
;
p
=
index
(
line
,
':'
);
p
=
strchr
(
line
,
':'
);
if
(
!
p
)
if
(
!
p
)
continue
;
continue
;
p
++
;
p
++
;
p2
=
index
(
p
,
':'
);
p2
=
strchr
(
p
,
':'
);
if
(
!
p2
)
if
(
!
p2
)
continue
;
continue
;
*
p2
=
'\0'
;
*
p2
=
'\0'
;
...
...
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