summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-12-04 01:31:10 +0000
committerderaadt <deraadt@openbsd.org>1996-12-04 01:31:10 +0000
commit5a93b9de97cb0d7f33e2af80a71535d80fed1b31 (patch)
treefaeec4a75c082c6663f621305cdbdfc5eaee9edd
parentMissing OpenBSD pieces, DOH! (diff)
downloadwireguard-openbsd-5a93b9de97cb0d7f33e2af80a71535d80fed1b31.tar.xz
wireguard-openbsd-5a93b9de97cb0d7f33e2af80a71535d80fed1b31.zip
use readlabelfs() if possible
-rw-r--r--sbin/fsck/Makefile4
-rw-r--r--sbin/fsck/fsck.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/sbin/fsck/Makefile b/sbin/fsck/Makefile
index 661563156ef..53fa7da36a0 100644
--- a/sbin/fsck/Makefile
+++ b/sbin/fsck/Makefile
@@ -1,8 +1,10 @@
-# $OpenBSD: Makefile,v 1.3 1996/10/20 08:36:22 tholo Exp $
+# $OpenBSD: Makefile,v 1.4 1996/12/04 01:31:10 deraadt Exp $
# $NetBSD: Makefile,v 1.14 1996/09/27 22:38:37 christos Exp $
PROG= fsck
SRCS= fsck.c fsutil.c preen.c
MAN= fsck.8
+DPADD= ${LIBUTIL}
+LDADD= -lutil
.include <bsd.prog.mk>
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 5d1a150975b..d105bdf723b 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsck.c,v 1.1 1996/10/20 08:36:24 tholo Exp $ */
+/* $OpenBSD: fsck.c,v 1.2 1996/12/04 01:31:11 deraadt Exp $ */
/* $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $ */
/*
@@ -54,6 +54,7 @@ static char rcsid[] = "$NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <util.h>
#include "pathnames.h"
#include "fsutil.h"
@@ -160,7 +161,10 @@ main(argc, argv)
for (; argc--; argv++) {
char *spec, *type;
- if ((fs = getfsfile(*argv)) == NULL &&
+ if (strncmp(*argv, "/dev/", 5) == 0 &&
+ (type = readlabelfs(*argv))) {
+ spec = *argv;
+ } else if ((fs = getfsfile(*argv)) == NULL &&
(fs = getfsspec(*argv)) == NULL) {
if (vfstype == NULL)
errx(1,
@@ -168,8 +172,7 @@ main(argc, argv)
*argv);
spec = *argv;
type = vfstype;
- }
- else {
+ } else {
spec = fs->fs_spec;
type = fs->fs_vfstype;
if (BADTYPE(fs->fs_type))