From bf7cc330196d76786a25da3a67b9c1e94b1126ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 12 Feb 2018 11:19:42 +0100 Subject: [PATCH 1/1] mount: fix/improve unmounting log messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The message in mount_dev_del() had a typo and was printing non-existing directory: 1) mount->dev is valid for /tmp/run/mountd/ 2) mount->name is valid for uci_path (e.g. /tmp/mounts/) The old message was mixing /tmp/run/mountd/ with mount->name. While at it change mount_remove() to match updated mount_dev_del(). Signed-off-by: Rafał Miłecki --- mount.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mount.c b/mount.c index cb3e03c..f196791 100644 --- a/mount.c +++ b/mount.c @@ -325,7 +325,7 @@ int mount_remove(char *path, char *dev) char tmp[256]; int ret; snprintf(tmp, 256, "%s%s", path, dev); - log_printf("%s has expired... unmounting\n", tmp); + log_printf("device %s has expired... unmounting %s\n", dev, tmp); ret = system_printf("/bin/umount %s", tmp); if(ret != 0) return 0; @@ -587,9 +587,8 @@ static void mount_dev_del(struct mount *mount) char tmp[256]; if (mount->status == STATUS_MOUNTED) { - snprintf(tmp, 256, "%s%s", "/tmp/run/mountd/", mount->name); - log_printf("%s has dissappeared ... unmounting\n", tmp); snprintf(tmp, 256, "%s%s", "/tmp/run/mountd/", mount->dev); + log_printf("device %s has disappeared ... unmounting %s\n", mount->dev, tmp); system_printf("/bin/umount %s", tmp); rmdir(tmp); snprintf(tmp, 64, "%s%s", uci_path, mount->name); -- 2.11.0