Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/fstyp Recognize wedges and device mapper volumes as...



details:   https://anonhg.NetBSD.org/src/rev/5959de532fe7
branches:  trunk
changeset: 466837:5959de532fe7
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Jan 03 07:50:58 2020 +0000

description:
Recognize wedges and device mapper volumes as "disk".

diffstat:

 usr.sbin/fstyp/fstyp.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 9ffb9a2e792e -r 5959de532fe7 usr.sbin/fstyp/fstyp.c
--- a/usr.sbin/fstyp/fstyp.c    Fri Jan 03 03:44:42 2020 +0000
+++ b/usr.sbin/fstyp/fstyp.c    Fri Jan 03 07:50:58 2020 +0000
@@ -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 @@
        int error, fd;
        struct stat sb;
        struct disklabel dl;
+       struct dkwedge_info dkw;
 
        fd = fileno(fp);
 
@@ -177,6 +178,8 @@
 
        error = ioctl(fd, DIOCGDINFO, &dl);
        if (error != 0)
+               error = ioctl(fd, DIOCGWEDGEINFO, &dkw);
+       if (error != 0)
                errx(EXIT_FAILURE, "%s: not a disk", path);
 }
 



Home | Main Index | Thread Index | Old Index