diff options
author | sos <sos@FreeBSD.org> | 1999-11-10 07:13:51 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1999-11-10 07:13:51 +0000 |
commit | 85f0f1d9984ba3f1b1e0dd3c7038bc3a17d06c7b (patch) | |
tree | 98d539ef36ffa85a867684ce2ec61720b1e3404c /sys/dev/ata/atapi-tape.c | |
parent | 926d27157159bc7e96a1179a94bbcd40e3f98463 (diff) | |
download | FreeBSD-src-85f0f1d9984ba3f1b1e0dd3c7038bc3a17d06c7b.zip FreeBSD-src-85f0f1d9984ba3f1b1e0dd3c7038bc3a17d06c7b.tar.gz |
Make the atapi device return sensible errno's back to userland.
Dont panic if a nonexistant device is opened.
Diffstat (limited to 'sys/dev/ata/atapi-tape.c')
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 99c02e4..70fcbc9 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -227,6 +227,9 @@ astopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) { struct ast_softc *stp = dev->si_drv1; + if (!stp) + return ENXIO; + if (stp->flags == F_OPEN) return EBUSY; @@ -469,10 +472,9 @@ ast_done(struct atapi_request *request) { struct buf *bp = request->bp; struct ast_softc *stp = request->driver; - int32_t error = request->result; - if (error) { - bp->b_error = error; + if (request->error) { + bp->b_error = request->error; bp->b_flags |= B_ERROR; } else { |