mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
Fixed the previous fix. The original path was annulled when it
was a directory, so the error message for attempting to unmount an unmounted-on directory was more broken than before.
This commit is contained in:
parent
4e649c4174
commit
82000ec41c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33038
@ -212,7 +212,7 @@ umountfs(name, typelist)
|
||||
struct timeval pertry, try;
|
||||
CLIENT *clp;
|
||||
int so;
|
||||
char *type, *delimp, *hostp, *mntpt, rname[MAXPATHLEN];
|
||||
char *type, *delimp, *hostp, *mntpt, *newname, rname[MAXPATHLEN];
|
||||
|
||||
if (realpath(name, rname) == NULL) {
|
||||
/* Continue and let the system call check it... */
|
||||
@ -233,11 +233,12 @@ umountfs(name, typelist)
|
||||
}
|
||||
name = rname;
|
||||
} else if (S_ISDIR(sb.st_mode)) {
|
||||
if ((name = getmntname(rname, MNTFROM, &type)) == NULL) {
|
||||
mntpt = rname;
|
||||
if ((newname = getmntname(mntpt, MNTFROM, &type)) == NULL) {
|
||||
warnx("%s: not currently mounted", name);
|
||||
return (1);
|
||||
}
|
||||
mntpt = rname;
|
||||
newname = name;
|
||||
} else {
|
||||
warnx("%s: not a directory or special device", name);
|
||||
return (1);
|
||||
|
Loading…
Reference in New Issue
Block a user