summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/fstab.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-12-23 14:44:36 +0000
committerpeter <peter@FreeBSD.org>1999-12-23 14:44:36 +0000
commit47c0955e5dabdd4264f087253df6621f6707cb6d (patch)
treec83fcd02a585e6f14f1d09e91b47329ba060a0a3 /lib/libc/gen/fstab.c
parentac36ce29354be4b200c37bd3f337d2874629ec1a (diff)
downloadFreeBSD-src-47c0955e5dabdd4264f087253df6621f6707cb6d.zip
FreeBSD-src-47c0955e5dabdd4264f087253df6621f6707cb6d.tar.gz
Fix the fixfsfile() so that it works for both block and character devices
as root. This could fix the "filesystem still dirty after fsck" problem. Submitted by: bde
Diffstat (limited to 'lib/libc/gen/fstab.c')
-rw-r--r--lib/libc/gen/fstab.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 65b02c1..5962fe2 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -32,7 +32,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] =
+ "$FreeBSD$";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -71,7 +76,8 @@ fixfsfile()
else
strcpy(buf, _PATH_DEV);
strcat(buf, sf.f_mntfromname);
- if (stat(buf, &sb) != 0 || !S_ISBLK(sb.st_mode))
+ if (stat(buf, &sb) != 0 ||
+ (!S_ISBLK(sb.st_mode) && !S_ISCHR(sb.st_mode)))
return;
_fs_fstab.fs_spec = buf;
}
OpenPOWER on IntegriCloud