[Libguestfs] [PATCH 5/5] umount: tidy up the path in log message
Wanlong Gao
gaowanlong at cn.fujitsu.com
Sat Jul 21 07:27:17 UTC 2012
Before patch:
><fs> xfs-info /badpath
libguestfs: error: xfs_info: xfs_info: /sysroot/badpath is not a mounted XFS filesystem
After patch:
><fs> umount /badpath
libguestfs: error: umount: /badpath: umount: /badpath: not found
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/mount.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/daemon/mount.c b/daemon/mount.c
index 0b91433..aa8df51 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -221,8 +221,11 @@ do_umount (const char *pathordevice,
free (buf);
if (r == -1) {
- reply_with_error ("%s: %s", pathordevice, err);
- free (err);
+ buf = tidy_log_path (err);
+ reply_with_error ("%s: %s", pathordevice, buf);
+ free (buf);
+ if (err)
+ free (err);
return -1;
}
--
1.7.11.2.249.g31c7954
More information about the Libguestfs
mailing list