diff options
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 1b30703..8fb6727 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -245,15 +245,23 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td) switch (cmd) { case DIOCGSECTORSIZE: error = g_io_getattr("GEOM::sectorsize", cp, &i, data); + if (error == 0 && *(u_int *)data == 0) + error = ENOENT; break; case DIOCGMEDIASIZE: error = g_io_getattr("GEOM::mediasize", cp, &i, data); + if (error == 0 && *(u_int *)data == 0) + error = ENOENT; break; case DIOCGFWSECTORS: error = g_io_getattr("GEOM::fwsectors", cp, &i, data); + if (error == 0 && *(u_int *)data == 0) + error = ENOENT; break; case DIOCGFWHEADS: error = g_io_getattr("GEOM::fwheads", cp, &i, data); + if (error == 0 && *(u_int *)data == 0) + error = ENOENT; break; case DIOCGFRONTSTUFF: error = g_io_getattr("GEOM::frontstuff", cp, &i, data); |