Module Name:    src
Committed By:   mlelstv
Date:           Fri Jan  3 07:50:58 UTC 2020

Modified Files:
        src/usr.sbin/fstyp: fstyp.c

Log Message:
Recognize wedges and device mapper volumes as "disk".


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/fstyp/fstyp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/fstyp/fstyp.c
diff -u src/usr.sbin/fstyp/fstyp.c:1.12 src/usr.sbin/fstyp/fstyp.c:1.13
--- src/usr.sbin/fstyp/fstyp.c:1.12	Thu Jan  2 08:52:42 2020
+++ src/usr.sbin/fstyp/fstyp.c	Fri Jan  3 07:50:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstyp.c,v 1.12 2020/01/02 08:52:42 tkusumi Exp $	*/
+/*	$NetBSD: fstyp.c,v 1.13 2020/01/03 07:50:58 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,11 +35,11 @@
  *
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: fstyp.c,v 1.12 2020/01/02 08:52:42 tkusumi Exp $");
+__RCSID("$NetBSD: fstyp.c,v 1.13 2020/01/03 07:50:58 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/disklabel.h>
-#include <sys/dkio.h>
+#include <sys/disk.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <err.h>
@@ -165,6 +165,7 @@ type_check(const char *path, FILE *fp)
 	int error, fd;
 	struct stat sb;
 	struct disklabel dl;
+	struct dkwedge_info dkw;
 
 	fd = fileno(fp);
 
@@ -177,6 +178,8 @@ type_check(const char *path, FILE *fp)
 
 	error = ioctl(fd, DIOCGDINFO, &dl);
 	if (error != 0)
+		error = ioctl(fd, DIOCGWEDGEINFO, &dkw);
+	if (error != 0)
 		errx(EXIT_FAILURE, "%s: not a disk", path);
 }
 

Reply via email to