summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorUmut Tezduyar <umut@tezduyar.com>2013-01-23 09:23:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-24 19:36:47 -0500
commitaa7cb2098302d45c8768ca08bf1e433a19aa46b9 (patch)
tree0e59cc88af62b0c4c37f21809bb4925711d184bf /src/core/mount.c
parent90527fbb2c48ffda5c6d8f232f8993a90b2632a4 (diff)
core: Set source for mountinfo .mount units
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 03eff9d9ed..e5f5e4272e 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1472,7 +1472,7 @@ static int mount_add_one(
int r;
Unit *u;
bool delete;
- char *e, *w = NULL, *o = NULL, *f = NULL;
+ char *e, *w = NULL, *o = NULL, *s = NULL, *f = NULL;
MountParameters *p;
bool load_extras = false;
@@ -1545,6 +1545,7 @@ static int mount_add_one(
if (!(w = strdup(what)) ||
!(o = strdup(options)) ||
+ !(s = strdup("/proc/self/mountinfo")) ||
!(f = strdup(fstype))) {
r = -ENOMEM;
goto fail;
@@ -1558,6 +1559,8 @@ static int mount_add_one(
}
MOUNT(u)->from_proc_self_mountinfo = true;
+ free(u->source_path);
+ u->source_path = s;
free(p->what);
p->what = w;
@@ -1583,6 +1586,7 @@ static int mount_add_one(
fail:
free(w);
free(o);
+ free(s);
free(f);
if (delete && u)