From 0fbebacdf1a377fb1351c60e65839bd376ed075a Mon Sep 17 00:00:00 2001 From: licheng Date: Tue, 20 Sep 2022 16:37:19 +0800 Subject: [PATCH] toys/lsb/mount: make "mount -a" can mount directory bind in /etc/fstab Example: /data/opt /opt none defaults,bind 0 0 Because of the "type" is "none", "if (!type)" will get false. And the directory mount as a devices. By adding another judgment: "if(!type || !strcmp(type, "none"))". it solved the problem. Signed-off-by: shiptux --- toys/lsb/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/lsb/mount.c b/toys/lsb/mount.c index dc379fc4..9317ed8b 100644 --- a/toys/lsb/mount.c +++ b/toys/lsb/mount.c @@ -178,7 +178,7 @@ static void mount_filesystem(char *dev, char *dir, char *type, if (type && !strcmp(type, "auto")) type = 0; if (flags & MS_MOVE) { if (type) error_exit("--move with -t"); - } else if (!type) { + } else if (!type || !strcmp(type, "none")) { struct stat stdev, stdir; // file on file or dir on dir is a --bind mount. -- 2.39.2