Re-enabled recognition of missiong or empty disk files as blank drive (rev 2997)

This commit is contained in:
Thomas Schmitt 2010-01-11 11:31:36 +00:00
parent 801828fd5c
commit dd30d37625
2 changed files with 9 additions and 4 deletions

View File

@ -326,7 +326,9 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
*/ */
role = burn_drive_get_drive_role(drive); role = burn_drive_get_drive_role(drive);
ret = burn_get_read_capacity(drive, &capacity, 0); ret = burn_get_read_capacity(drive, &capacity, 0);
if ((ret > 0 && capacity > 0) || role == 2) { if (ret <= 0)
capacity = -1;
if (capacity > 0 || role == 2) {
/* Might be a block device on a system where libburn cannot determine its /* Might be a block device on a system where libburn cannot determine its
size. Try to read anyway. */ size. Try to read anyway. */
memset(o->target_iso_head, 0, Libisoburn_target_head_sizE); memset(o->target_iso_head, 0, Libisoburn_target_head_sizE);
@ -336,8 +338,11 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head, ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
to_read, &data_count, 2); to_read, &data_count, 2);
if (ret <= 0) { if (ret <= 0) {
/* an error means a full disc with no ISO image */ /* an error means a disc with no ISO image */
o->fabricated_disc_status= BURN_DISC_FULL; if (capacity > 0)
o->fabricated_disc_status= BURN_DISC_FULL;
else
o->fabricated_disc_status= BURN_DISC_BLANK;
return 1; return 1;
} }
} else { } else {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.01.01.130215" #define Xorriso_timestamP "2010.01.11.113303"