comparison toys/pending/mount.c @ 1461:67c1402e9723 draft

Fix mount --move bug.
author Rob Landley <rob@landley.net>
date Sun, 07 Sep 2014 19:30:05 -0500
parents 94f7ec50ef50
children
comparison
equal deleted inserted replaced
1460:94f7ec50ef50 1461:67c1402e9723
137 return; 137 return;
138 } 138 }
139 } 139 }
140 140
141 // Autodetect bind mount or filesystem type 141 // Autodetect bind mount or filesystem type
142 if (!(flags & MS_MOVE) && (!type || !strcmp(type, "auto"))) { 142
143 if (type && !strcmp(type, "auto")) type = 0;
144 if (flags & MS_MOVE) {
145 if (type) error_exit("--move with -t");
146 } else if (!type) {
143 struct stat stdev, stdir; 147 struct stat stdev, stdir;
144 148
145 // file on file or dir on dir is a --bind mount. 149 // file on file or dir on dir is a --bind mount.
146 if (!stat(dev, &stdev) && !stat(dir, &stdir) 150 if (!stat(dev, &stdev) && !stat(dir, &stdir)
147 && ((S_ISREG(stdev.st_mode) && S_ISREG(stdir.st_mode)) 151 && ((S_ISREG(stdev.st_mode) && S_ISREG(stdir.st_mode))