cgfsng: cg_hybrid_get_mountpoint()

parent 9888a112
...@@ -955,17 +955,15 @@ static struct hierarchy *add_hierarchy(char **clist, char *mountpoint, ...@@ -955,17 +955,15 @@ static struct hierarchy *add_hierarchy(char **clist, char *mountpoint,
return new; return new;
} }
/* /* Get a copy of the mountpoint from @line, which is a line from
* Get a copy of the mountpoint from @line, which is a line from * /proc/self/mountinfo.
* /proc/self/mountinfo
*/ */
static char *cg_hybrid_get_mountpoint(char *line) static char *cg_hybrid_get_mountpoint(char *line)
{ {
int i; int i;
char *p2;
size_t len; size_t len;
char *p = line; char *p2;
char *sret = NULL; char *p = line, *sret = NULL;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
p = strchr(p, ' '); p = strchr(p, ' ');
...@@ -974,7 +972,7 @@ static char *cg_hybrid_get_mountpoint(char *line) ...@@ -974,7 +972,7 @@ static char *cg_hybrid_get_mountpoint(char *line)
p++; p++;
} }
if (strncmp(p, "/sys/fs/cgroup/", 15)) if (strncmp(p, "/sys/fs/cgroup/", 15) != 0)
return NULL; return NULL;
p2 = strchr(p + 15, ' '); p2 = strchr(p + 15, ' ');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment