aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-09-07 19:30:05 -0500
committerRob Landley <rob@landley.net>2014-09-07 19:30:05 -0500
commitcc3bf66666cb0d2c8937b1a60c2be8d3f5a49d04 (patch)
tree3425a229ece929f265c50cd4cf9961f460d9e88a /toys
parent25fe0e0bea85f1d851ce03a90c0f1bf41ab431f2 (diff)
downloadtoybox-cc3bf66666cb0d2c8937b1a60c2be8d3f5a49d04.tar.gz
Fix mount --move bug.
Diffstat (limited to 'toys')
-rw-r--r--toys/pending/mount.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/toys/pending/mount.c b/toys/pending/mount.c
index 53b16bc7..4962df3f 100644
--- a/toys/pending/mount.c
+++ b/toys/pending/mount.c
@@ -139,7 +139,11 @@ static void mount_filesystem(char *dev, char *dir, char *type,
}
// Autodetect bind mount or filesystem type
- if (!(flags & MS_MOVE) && (!type || !strcmp(type, "auto"))) {
+
+ if (type && !strcmp(type, "auto")) type = 0;
+ if (flags & MS_MOVE) {
+ if (type) error_exit("--move with -t");
+ } else if (!type) {
struct stat stdev, stdir;
// file on file or dir on dir is a --bind mount.