aboutsummaryrefslogtreecommitdiff
path: root/sbin/quotacheck/preen.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-11-27 20:02:27 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-11-27 20:02:27 +0000
commitff180522d81def73e89ec06b0e82d459144a5e26 (patch)
tree0e8192f6898a523842569950cced0375b0fbc2df /sbin/quotacheck/preen.c
parent5bb83b98dbde8326de7b8221ef899ca38ddb3180 (diff)
downloadsrc-ff180522d81def73e89ec06b0e82d459144a5e26.tar.gz
src-ff180522d81def73e89ec06b0e82d459144a5e26.zip
Make fsck even more char/blk dev tolerant.
Notes
Notes: svn path=/head/; revision=53781
Diffstat (limited to 'sbin/quotacheck/preen.c')
-rw-r--r--sbin/quotacheck/preen.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/sbin/quotacheck/preen.c b/sbin/quotacheck/preen.c
index aedb5921cd99..fc6dd23c4307 100644
--- a/sbin/quotacheck/preen.c
+++ b/sbin/quotacheck/preen.c
@@ -309,24 +309,16 @@ retry:
printf("Can't stat %s: %s\n", newname, strerror(errno));
return (origname);
}
- if ((stblock.st_mode & S_IFMT) == S_IFBLK ||
- (stblock.st_mode & S_IFMT) == S_IFCHR) {
+ switch(stblock.st_mode & S_IFMT) {
+ case S_IFCHR:
+ case S_IFBLK:
if (stslash.st_dev == stblock.st_rdev)
hotroot++;
- raw = newname;
- if (stat(raw, &stchar) < 0) {
- printf("Can't stat %s: %s\n", raw, strerror(errno));
- return (origname);
- }
- if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
- if (stslash.st_dev == stchar.st_rdev)
- hotroot++;
- return (raw);
- } else {
- printf("%s is not a character device\n", raw);
- return (origname);
- }
- } else if ((stblock.st_mode & S_IFMT) == S_IFDIR && !retried) {
+ return(newname);
+ case S_IFDIR:
+ if (retried)
+ break;
+
len = strlen(origname) - 1;
if (len > 0 && origname[len] == '/')
/* remove trailing slash */