diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index af1e48f71a14..491acfeb398c 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -1,4 +1,4 @@ -/* $NetBSD: fsck.c,v 1.35 2004/08/19 22:28:38 christos Exp $ */ +/* $NetBSD: fsck.c,v 1.36 2004/09/25 03:32:52 thorpej Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsck.c,v 1.35 2004/08/19 22:28:38 christos Exp $"); +__RCSID("$NetBSD: fsck.c,v 1.36 2004/09/25 03:32:52 thorpej Exp $"); #endif /* not lint */ #include @@ -45,6 +45,7 @@ __RCSID("$NetBSD: fsck.c,v 1.35 2004/08/19 22:28:38 christos Exp $"); #include #define FSTYPENAMES #define FSCKNAMES +#include #include #include @@ -490,10 +491,10 @@ mangle(char *opts, int *argcp, const char ***argvp, int *maxargcp) *maxargcp = maxargc; } - const static char * getfslab(const char *str) { + static struct dkwedge_info dkw; struct disklabel dl; int fd; char p; @@ -504,6 +505,13 @@ getfslab(const char *str) if ((fd = open(str, O_RDONLY)) == -1) err(1, "cannot open `%s'", str); + /* First check to see if it's a wedge. */ + if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) { + /* Yup, this is easy. */ + (void) close(fd); + return (dkw.dkw_ptype); + } + if (ioctl(fd, DIOCGDINFO, &dl) == -1) err(1, "cannot get disklabel for `%s'", str); diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 40539ec96522..6db7ef7eb205 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.72 2004/08/19 23:02:09 christos Exp $ */ +/* $NetBSD: mount.c,v 1.73 2004/09/25 03:32:52 thorpej Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.72 2004/08/19 23:02:09 christos Exp $"); +__RCSID("$NetBSD: mount.c,v 1.73 2004/09/25 03:32:52 thorpej Exp $"); #endif #endif /* not lint */ @@ -59,6 +59,7 @@ __RCSID("$NetBSD: mount.c,v 1.72 2004/08/19 23:02:09 christos Exp $"); #define MOUNTNAMES #include +#include #include #include @@ -660,6 +661,7 @@ static const char * getfslab(str) const char *str; { + static struct dkwedge_info dkw; struct disklabel dl; int fd; int part; @@ -689,6 +691,13 @@ getfslab(str) return (NULL); } + /* Check to see if this is a wedge. */ + if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) { + /* Yup, this is easy. */ + (void) close(fd); + return (dkw.dkw_ptype); + } + if (ioctl(fd, DIOCGDINFO, &dl) == -1) { (void) close(fd); return (NULL);