Search
lxdream.org :: lxdream :: r1177:bd5893522efc
lxdream 0.9.1
released Jun 29
Download Now
changeset1177:bd5893522efc
parent1176:70feb1749427
child1178:e55ec927d55d
authorNathan Keynes <nkeynes@lxdream.org>
dateSat Sep 17 22:35:45 2011 +1000 (8 years ago)
When initial disc read-toc fails, return the actual failure error code rather than
overwriting it with LX_ERR_FILE_UNKNOWN - if the read-toc failed, we
identified the file, it just didn't work
src/drivers/cdrom/cdrom.c
1.1 --- a/src/drivers/cdrom/cdrom.c Thu May 12 08:45:25 2011 +1000
1.2 +++ b/src/drivers/cdrom/cdrom.c Sat Sep 17 22:35:45 2011 +1000
1.3 @@ -266,14 +266,18 @@
1.4 }
1.5 }
1.6
1.7 - if( disc->read_toc != NULL && cdrom_disc_read_toc( disc, err ) ) {
1.8 - /* All good */
1.9 - return disc;
1.10 - } else {
1.11 + if( disc->read_toc == NULL ) {
1.12 /* No handler found for file */
1.13 cdrom_disc_unref( disc );
1.14 SET_ERROR( err, LX_ERR_FILE_UNKNOWN, "File '%s' could not be recognized as any known image file or device type", filename );
1.15 return NULL;
1.16 + } else if( !cdrom_disc_read_toc( disc, err ) ) {
1.17 + cdrom_disc_unref( disc );
1.18 + assert( err == NULL || err->code != LX_ERR_NONE ); /* Read-toc should have set an error code in this case */
1.19 + return NULL;
1.20 + } else {
1.21 + /* All good */
1.22 + return disc;
1.23 }
1.24 }
1.25
.