[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvz-criu
Subject:    [CRIU] [PATCH] mnt: Stop commas from options string
From:       xemul () parallels ! com (Pavel Emelyanov)
Date:       2014-05-30 11:31:59
Message-ID: 53886C2F.8020306 () parallels ! com
[Download RAW message or body]

Not all filesystems like it. Other than this options in the
image just look cleaner.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---

 mount.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index f347f1e..3c0576a 100644
--- a/mount.c
+++ b/mount.c
@@ -774,6 +774,19 @@ uns:
 	return &fstypes[0];
 }
 
+static char *strip(char *opt)
+{
+	int len;
+
+	len = strlen(opt);
+	if (len > 1 && opt[len - 1] == ',')
+		opt[len - 1] = '\0';
+	if (opt[0] == ',')
+		opt++;
+
+	return opt;
+}
+
 static int dump_one_mountpoint(struct mount_info *pm, int fd)
 {
 	MntEntry me = MNT_ENTRY__INIT;
@@ -808,7 +821,7 @@ static int dump_one_mountpoint(struct mount_info *pm, int fd)
 	me.root			= pm->root;
 	me.mountpoint		= pm->mountpoint + 1;
 	me.source		= pm->source;
-	me.options		= pm->options;
+	me.options		= strip(pm->options);
 	me.shared_id		= pm->shared_id;
 	me.has_shared_id	= true;
 	me.master_id		= pm->master_id;
-- 
1.8.4.2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic