diff options
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r-- | sys/dev/fdc/fdc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index f4068ef..b6ec2c3 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -2622,10 +2622,14 @@ fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) switch (cmd) { case DIOCGMEDIASIZE: + if (fd->ft == 0) + return ((fd->flags & FD_NONBLOCK) ? EAGAIN : ENXIO); *(off_t *)addr = (128 << (fd->ft->secsize)) * fd->ft->size; return (0); case DIOCGSECTORSIZE: + if (fd->ft == 0) + return ((fd->flags & FD_NONBLOCK) ? EAGAIN : ENXIO); *(u_int *)addr = 128 << (fd->ft->secsize); return (0); |