Search
lxdream.org :: lxdream/src/drivers/cdrom/cd_gdi.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/cdrom/cd_gdi.c
changeset 1109:700c5ab26a63
prev1097:d4807997e450
next1286:8376a612a79d
author nkeynes
date Thu Jun 10 22:13:16 2010 +1000 (12 years ago)
permissions -rw-r--r--
last change Integrate executable wrapping into the user interface
- command-line now loads wrapped by default, -e <bin> to run binary
- add support for .bin executables
- Add useful (internal) error codes
file annotate diff log raw
1.1 --- a/src/drivers/cdrom/cd_gdi.c Sun Jan 31 18:35:06 2010 +1000
1.2 +++ b/src/drivers/cdrom/cd_gdi.c Thu Jun 10 22:13:16 2010 +1000
1.3 @@ -64,12 +64,12 @@
1.4 fseek(f, 0, SEEK_SET);
1.5
1.6 if( fgets( line, sizeof(line), f ) == NULL ) {
1.7 - SET_ERROR( err, EINVAL, "Invalid GDI image" );
1.8 + SET_ERROR( err, LX_ERR_FILE_INVALID, "Invalid GDI image" );
1.9 return FALSE;
1.10 }
1.11 track_count = strtoul(line, NULL, 0);
1.12 if( track_count == 0 || track_count > 99 ) {
1.13 - SET_ERROR( err, EINVAL, "Invalid GDI image" );
1.14 + SET_ERROR( err, LX_ERR_FILE_INVALID, "Invalid GDI image" );
1.15 return FALSE;
1.16 }
1.17
1.18 @@ -83,7 +83,7 @@
1.19
1.20 if( fgets( line, sizeof(line), f ) == NULL ) {
1.21 cdrom_disc_unref(disc);
1.22 - SET_ERROR( err, EINVAL, "Invalid GDI image - unexpected end of file" );
1.23 + SET_ERROR( err, LX_ERR_FILE_INVALID, "Invalid GDI image - unexpected end of file" );
1.24 return FALSE;
1.25 }
1.26 sscanf( line, "%d %d %d %d %s %d", &track_no, &start_lba, &flags, &size,
1.27 @@ -105,7 +105,7 @@
1.28 case 2336: mode = SECTOR_SEMIRAW_MODE2; break;
1.29 case 2352: mode = SECTOR_RAW_XA; break;
1.30 default:
1.31 - SET_ERROR( err, EINVAL, "Invalid sector size '%d' in GDI track %d", size, (i+1) );
1.32 + SET_ERROR( err, LX_ERR_FILE_INVALID, "Invalid sector size '%d' in GDI track %d", size, (i+1) );
1.33 g_free(dirname);
1.34 return FALSE;
1.35 }
1.36 @@ -115,7 +115,7 @@
1.37 if( size == 0 )
1.38 size = 2352;
1.39 else if( size != 2352 ) {
1.40 - SET_ERROR( err, EINVAL, "Invalid sector size '%d' for audio track %d", size, (i+1) );
1.41 + SET_ERROR( err, LX_ERR_FILE_INVALID, "Invalid sector size '%d' for audio track %d", size, (i+1) );
1.42 g_free(dirname);
1.43 return FALSE;
1.44 }
1.45 @@ -128,7 +128,8 @@
1.46 offset, FILE_SECTOR_FULL_FILE );
1.47 g_free(pathname);
1.48 if( disc->track[i].source == NULL ) {
1.49 - SET_ERROR( err, ENOENT, "GDI track file '%s' could not be opened (%s)", filename, strerror(errno) );
1.50 + /* Note: status is invalid because it's a failure of the GDI file */
1.51 + SET_ERROR( err, LX_ERR_FILE_INVALID, "GDI track file '%s' could not be opened (%s)", filename, strerror(errno) );
1.52 g_free(dirname);
1.53 return FALSE;
1.54 }
.