diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-09-26 22:52:51 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-09-26 22:52:51 +0000 |
commit | c5bc11017e96c2b75ea7dd85e3d980145e3b319e (patch) | |
tree | 886ca72f7766516db2e34dc5282979030f117f2d /sys/arch/amd64 | |
parent | 1eae2bddb310197dc357ee38502c26c789b8dbe8 (diff) |
Use SCSI_IGNORE_ILLEGAL_REQUEST when reading a cd's table of contents.
ILLEGAL REQUEST is correctly reported for blank media, as an
informative FreeBSD comment pointed out. Ensure the returned table of
contents is always initialized to zero. Call readdisklabel with
spoofonly = 1 when no data tracks are found.
Don't try to read the DOS label from the device if spoofonly is 1.
Only done for amd64 here. More archs to follow.
Eliminates scsi error messages when attempting to open a cd containing
blank media, as pointed out by Michael Coulter.
ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/disksubr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c index 246a4c6ec0f..c01e4dc5443 100644 --- a/sys/arch/amd64/amd64/disksubr.c +++ b/sys/arch/amd64/amd64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.3 2005/03/30 07:52:31 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.4 2005/09/26 22:52:50 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -126,6 +126,11 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (part_blkno < extoff) part_blkno = extoff; + if (spoofonly) { + bzero(dp, NDOSPART * sizeof(*dp)); + goto donot; + } + /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; |