summaryrefslogtreecommitdiffstats
path: root/sbin/umount/umount.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-11-04 17:51:37 +0000
committerdg <dg@FreeBSD.org>1994-11-04 17:51:37 +0000
commitf9ee10c7bb885ede73c5ea3505cf4ea1185a7543 (patch)
tree7167f55af6121357242cba8ca459aa938b10820d /sbin/umount/umount.c
parent2c9c58ec9dd2cff0a098f4bf8efa86b6ab97771c (diff)
downloadFreeBSD-src-f9ee10c7bb885ede73c5ea3505cf4ea1185a7543.zip
FreeBSD-src-f9ee10c7bb885ede73c5ea3505cf4ea1185a7543.tar.gz
From njw@cs.city.ac.uk (Nick Williams):
/sbin/umount does not return the correct exit status due to incorrect logic in its internals. Further, because of the nature of the code, you *cannot* use it to umount a directory from a union mountpoint. Well, you can sometimes, it depends on if the directory is at the top of the union stack or not :) Submitted by: njw@cs.city.ac.uk (Nick Williams)
Diffstat (limited to 'sbin/umount/umount.c')
-rw-r--r--sbin/umount/umount.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c
index 56660de..9059bab 100644
--- a/sbin/umount/umount.c
+++ b/sbin/umount/umount.c
@@ -128,8 +128,7 @@ main(argc, argv)
errs = umountall();
} else
for (errs = 0; *argv != NULL; ++argv)
- if (umountfs(*argv) == 0)
- errs = 1;
+ errs += umountfs(*argv);
exit(errs);
}
@@ -174,6 +173,7 @@ umountall()
return (0);
}
+/* Returns 1 on failure, 0 on success */
int
umountfs(name)
char *name;
@@ -188,8 +188,8 @@ umountfs(name)
char *delimp, *hostp, *mntpt, rname[MAXPATHLEN];
if (realpath(name, rname) == NULL) {
- warn("%s", rname);
- return (0);
+ /* Continue and let the system call check it... */
+ strcpy(rname, name);
}
name = rname;
OpenPOWER on IntegriCloud