From: David van Moolenbroek Date: Sun, 1 Sep 2013 12:34:17 +0000 (+0200) Subject: Block drivers: reply ENOTTY to unknown IOCTLs X-Git-Tag: v3.3.0~596 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=26cb85535e8d5a55a0ebd41c6aa9805c451fc357;p=minix.git Block drivers: reply ENOTTY to unknown IOCTLs Change-Id: Ie2e82d2491d546f4dd73b009100646e249a147b5 --- diff --git a/drivers/ahci/ahci.c b/drivers/ahci/ahci.c index 1c7282622..0c108e42a 100644 --- a/drivers/ahci/ahci.c +++ b/drivers/ahci/ahci.c @@ -2685,7 +2685,7 @@ static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, sizeof(val)); } - return EINVAL; + return ENOTTY; } /*===========================================================================* diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 00943acc1..349ffeb91 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -2290,7 +2290,7 @@ static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, return (w_wn->w_status & (STATUS_ERR|STATUS_WF)) ? EIO : OK; } - return EINVAL; + return ENOTTY; } /*===========================================================================* diff --git a/drivers/cat24c256/cat24c256.c b/drivers/cat24c256/cat24c256.c index b52cb73a8..ba5d4b44b 100644 --- a/drivers/cat24c256/cat24c256.c +++ b/drivers/cat24c256/cat24c256.c @@ -219,7 +219,7 @@ cat24c256_blk_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, { log_trace(&log, "cat24c256_blk_ioctl(%d)\n", minor); /* no supported ioctls for this device */ - return EINVAL; + return ENOTTY; } static struct device * diff --git a/drivers/filter/main.c b/drivers/filter/main.c index b825ed31c..742a543fa 100644 --- a/drivers/filter/main.c +++ b/drivers/filter/main.c @@ -269,7 +269,7 @@ static int do_ioctl(message *m) default: printf("Filter: unknown ioctl request: %d!\n", m->BDEV_REQUEST); - return EINVAL; + return ENOTTY; } return OK; diff --git a/drivers/mmc/mmcblk.c b/drivers/mmc/mmcblk.c index 9664408be..c40143995 100644 --- a/drivers/mmc/mmcblk.c +++ b/drivers/mmc/mmcblk.c @@ -469,7 +469,7 @@ block_ioctl(dev_t minor, return OK; } - return EINVAL; + return ENOTTY; } /*===========================================================================* diff --git a/drivers/tda19988/tda19988.c b/drivers/tda19988/tda19988.c index c8bbeff9a..c02c36946 100644 --- a/drivers/tda19988/tda19988.c +++ b/drivers/tda19988/tda19988.c @@ -178,7 +178,7 @@ struct blockdriver tda19988_tab = { .bdr_open = tda19988_blk_open, .bdr_close = tda19988_blk_close, .bdr_transfer = tda19988_blk_transfer, - .bdr_ioctl = tda19988_blk_ioctl, /* nop -- always returns EINVAL */ + .bdr_ioctl = tda19988_blk_ioctl, /* nop -- always returns ENOTTY */ .bdr_cleanup = NULL, /* nothing allocated -- nothing to clean up */ .bdr_part = tda19988_blk_part, .bdr_geometry = NULL, /* no geometry (cylinders, heads, sectors, etc) */ @@ -324,7 +324,7 @@ tda19988_blk_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, { log_trace(&log, "tda19988_blk_ioctl(%d)\n", minor); /* no supported ioctls for this device */ - return EINVAL; + return ENOTTY; } static struct device * diff --git a/drivers/virtio_blk/virtio_blk.c b/drivers/virtio_blk/virtio_blk.c index 141552438..a4ce7e176 100644 --- a/drivers/virtio_blk/virtio_blk.c +++ b/drivers/virtio_blk/virtio_blk.c @@ -390,7 +390,7 @@ virtio_blk_ioctl(dev_t minor, unsigned int req, endpoint_t endpt, } - return EINVAL; + return ENOTTY; } static struct device * diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index f45b11552..eb3f479c8 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -345,7 +345,7 @@ static int do_ioctl(struct blockdriver *bdp, message *mp) if (bdp->bdr_ioctl) r = (*bdp->bdr_ioctl)(minor, request, mp->m_source, grant); else - r = EINVAL; + r = ENOTTY; } return r;