diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-02-10 00:41:49 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-02-10 00:41:49 +0100 |
commit | be41c805265881172e8004c81dd646ad579c8009 (patch) | |
tree | 52f4633bbd55d1638def827cbc47aa28c1515a81 /linux/src/drivers/block/ide-cd.c | |
parent | 55cdcf3ad3ebec3d9899130fe435a59f8e9e1617 (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/drivers/block/ide-cd.c')
-rw-r--r-- | linux/src/drivers/block/ide-cd.c | 4 |
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; } } |