Skip to content

Commit

Permalink
conf: cull_mntent_opt()
Browse files Browse the repository at this point in the history
non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Aug 15, 2017
1 parent d9cda2c commit cebba72
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/lxc/conf.c
Expand Up @@ -1762,28 +1762,27 @@ static int mount_entry(const char *fsname, const char *target,
return 0;
}

/*
* Remove 'optional', 'create=dir', and 'create=file' from mntopt
*/
/* Remove "optional", "create=dir", and "create=file" from mntopt */
static void cull_mntent_opt(struct mntent *mntent)
{
int i;
char *p, *p2;
char *list[] = {"create=dir",
"create=file",
"optional",
NULL };

for (i=0; list[i]; i++) {
if (!(p = strstr(mntent->mnt_opts, list[i])))
char *list[] = {"create=dir", "create=file", "optional", NULL};

for (i = 0; list[i]; i++) {
char *p, *p2;

p = strstr(mntent->mnt_opts, list[i]);
if (!p)
continue;

p2 = strchr(p, ',');
if (!p2) {
/* no more mntopts, so just chop it here */
*p = '\0';
continue;
}
memmove(p, p2+1, strlen(p2+1)+1);

memmove(p, p2 + 1, strlen(p2 + 1) + 1);
}
}

Expand Down

0 comments on commit cebba72

Please sign in to comment.