summaryrefslogtreecommitdiff
path: root/linux/src
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-10 00:41:49 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-10 00:41:49 +0100
commitbe41c805265881172e8004c81dd646ad579c8009 (patch)
tree52f4633bbd55d1638def827cbc47aa28c1515a81 /linux/src
parent55cdcf3ad3ebec3d9899130fe435a59f8e9e1617 (diff)
Make open return ENXIO on missing CD-ROM
* linux/src/drivers/block/ide-cd.c (ide_cdrom_open): Return -ENXIO when CD sense failed.
Diffstat (limited to 'linux/src')
-rw-r--r--linux/src/drivers/block/ide-cd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux/src/drivers/block/ide-cd.c b/linux/src/drivers/block/ide-cd.c
index ccf7954..020a831 100644
--- a/linux/src/drivers/block/ide-cd.c
+++ b/linux/src/drivers/block/ide-cd.c
@@ -2643,6 +2643,10 @@ int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
if (stat == 0 || my_reqbuf.sense_key == UNIT_ATTENTION) {
(void) cdrom_lockdoor (drive, 1, &my_reqbuf);
(void) cdrom_read_toc (drive, &my_reqbuf);
+ } else {
+ /* Otherwise return as missing */
+ --drive->usage;
+ return -ENXIO;
}
}