diff --git a/libburn/drive.c b/libburn/drive.c index a33260b..041e8e0 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -410,3 +410,14 @@ int burn_drive_is_banned(char *device_address) return 0; return 1; } + +/* ts A60822 */ +int burn_drive_is_open(struct burn_drive *d) +{ + /* a bit more detailed case distinction than needed */ + if(d->fd == -1337) + return 0; + if(d->fd < 0) + return 0; + return 1; +} diff --git a/libburn/drive.h b/libburn/drive.h index e6f7e27..7f4ebc8 100644 --- a/libburn/drive.h +++ b/libburn/drive.h @@ -50,4 +50,7 @@ void burn_disc_erase_sync(struct burn_drive *d, int fast); int burn_drive_get_block_types(struct burn_drive *d, enum burn_write_types write_type); +/* ts A60822 */ +int burn_drive_is_open(struct burn_drive *d); + #endif /* __DRIVE */