Bug fix: burn_abort() did not work with broken output pipe (since rev 2514)

This commit is contained in:
Thomas Schmitt 2009-03-18 17:25:00 +00:00
parent f87747802a
commit 9cb4e4281e
2 changed files with 31 additions and 7 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.03.18.124558"
#define Cdrskin_timestamP "2009.03.18.172512"

View File

@ -1742,6 +1742,10 @@ int burn_abort(int patience,
unsigned long wait_grain= 100000;
time_t start_time, current_time, pacifier_time, end_time;
#ifndef NIX
time_t stdio_patience = 3;
#endif
current_time = start_time = pacifier_time = time(0);
end_time = start_time + patience;
@ -1758,15 +1762,35 @@ int burn_abort(int patience,
if(occup == -2)
continue;
#ifdef NIX
/* <<< this causes a race condition with drive usage
and drive disposal
*/
if(drive_array[i].drive_role != 1) {
#ifdef NIX
/* ts A90302
<<< this causes a race condition with drive
usage and drive disposal.
*/
drive_array[i].busy = BURN_DRIVE_IDLE;
burn_drive_forget(&(drive_array[i]), 1);
} else
#endif /* NIX */
continue;
#else /* NIX */
/* ts A90318
>>> but if a pipe breaks then the drive
never gets idle.
So for now with a short patience timespan
and eventually a deliberate memory leak.
*/
if (current_time - start_time >
stdio_patience) {
drive_array[i].global_index = -1;
continue;
}
#endif /* ! NIX */
}
if(occup <= 10) {
burn_drive_forget(&(drive_array[i]), 1);