Bug fix, read errors are now handled propertly.

This commit is contained in:
Vreixo Formoso 2008-02-08 10:31:09 +01:00
parent 444689d163
commit e57b51a160

View File

@ -302,6 +302,10 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
for (b = 0; b < nblocks; ++b) { for (b = 0; b < nblocks; ++b) {
int wres; int wres;
res = filesrc_read(file, buffer, BLOCK_SIZE); res = filesrc_read(file, buffer, BLOCK_SIZE);
if (res <= 0) {
/* read error */
break;
}
wres = iso_write(t, buffer, BLOCK_SIZE); wres = iso_write(t, buffer, BLOCK_SIZE);
if (wres < 0) { if (wres < 0) {
/* ko, writer error, we need to go out! */ /* ko, writer error, we need to go out! */