Commit aa7cb209 authored by Umut Tezduyar's avatar Umut Tezduyar Committed by Zbigniew Jędrzejewski-Szmek
Browse files

core: Set source for mountinfo .mount units

parent 90527fbb
...@@ -1472,7 +1472,7 @@ static int mount_add_one( ...@@ -1472,7 +1472,7 @@ static int mount_add_one(
int r; int r;
Unit *u; Unit *u;
bool delete; bool delete;
char *e, *w = NULL, *o = NULL, *f = NULL; char *e, *w = NULL, *o = NULL, *s = NULL, *f = NULL;
MountParameters *p; MountParameters *p;
bool load_extras = false; bool load_extras = false;
...@@ -1545,6 +1545,7 @@ static int mount_add_one( ...@@ -1545,6 +1545,7 @@ static int mount_add_one(
if (!(w = strdup(what)) || if (!(w = strdup(what)) ||
!(o = strdup(options)) || !(o = strdup(options)) ||
!(s = strdup("/proc/self/mountinfo")) ||
!(f = strdup(fstype))) { !(f = strdup(fstype))) {
r = -ENOMEM; r = -ENOMEM;
goto fail; goto fail;
...@@ -1558,6 +1559,8 @@ static int mount_add_one( ...@@ -1558,6 +1559,8 @@ static int mount_add_one(
} }
MOUNT(u)->from_proc_self_mountinfo = true; MOUNT(u)->from_proc_self_mountinfo = true;
free(u->source_path);
u->source_path = s;
free(p->what); free(p->what);
p->what = w; p->what = w;
...@@ -1583,6 +1586,7 @@ static int mount_add_one( ...@@ -1583,6 +1586,7 @@ static int mount_add_one(
fail: fail:
free(w); free(w);
free(o); free(o);
free(s);
free(f); free(f);
if (delete && u) if (delete && u)
......
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