Fixed a race condition on abort with stdio writing which could cause SIGSEGV

This commit is contained in:
Thomas Schmitt 2009-03-02 19:33:47 +00:00
parent 8c56ca131f
commit d74b1a2008
2 changed files with 10 additions and 2 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.03.02.170126"
#define Cdrskin_timestamP "2009.03.02.193353"

View File

@ -1757,10 +1757,18 @@ int burn_abort(int patience,
occup = burn_drive_is_occupied(&(drive_array[i]));
if(occup == -2)
continue;
#ifdef NIX
/* <<< this causes a race condition with drive usage
and drive disposal
*/
if(drive_array[i].drive_role != 1) {
drive_array[i].busy = BURN_DRIVE_IDLE;
burn_drive_forget(&(drive_array[i]), 1);
} else if(occup <= 10) {
} else
#endif /* NIX */
if(occup <= 10) {
burn_drive_forget(&(drive_array[i]), 1);
} else if(occup <= 100) {
if(first_round)