From dd30d37625d1a2e65cda34b2e16de99bf4ecb17b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 11 Jan 2010 11:31:36 +0000 Subject: [PATCH] Re-enabled recognition of missiong or empty disk files as blank drive (rev 2997) --- libisoburn/trunk/libisoburn/isofs_wrap.c | 11 ++++++++--- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libisoburn/trunk/libisoburn/isofs_wrap.c b/libisoburn/trunk/libisoburn/isofs_wrap.c index 219f47ba..42715ad6 100644 --- a/libisoburn/trunk/libisoburn/isofs_wrap.c +++ b/libisoburn/trunk/libisoburn/isofs_wrap.c @@ -326,7 +326,9 @@ int isoburn_start_emulation(struct isoburn *o, int flag) */ role = burn_drive_get_drive_role(drive); 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 size. Try to read anyway. */ 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, to_read, &data_count, 2); if (ret <= 0) { - /* an error means a full disc with no ISO image */ - o->fabricated_disc_status= BURN_DISC_FULL; + /* an error means a disc with no ISO image */ + if (capacity > 0) + o->fabricated_disc_status= BURN_DISC_FULL; + else + o->fabricated_disc_status= BURN_DISC_BLANK; return 1; } } else { diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 828690ce..5c702e1c 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.01.01.130215" +#define Xorriso_timestamP "2010.01.11.113303"