From ca857610d52fcf5eeeb8643d6eb086be0198c6e0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 22 Aug 2006 17:42:44 +0000 Subject: [PATCH] Introduced new internal function burn_drive_is_open --- trunk/libburn/drive.c | 11 +++++++++++ trunk/libburn/drive.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/trunk/libburn/drive.c b/trunk/libburn/drive.c index a33260b6..041e8e08 100644 --- a/trunk/libburn/drive.c +++ b/trunk/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/trunk/libburn/drive.h b/trunk/libburn/drive.h index e6f7e27d..7f4ebc8b 100644 --- a/trunk/libburn/drive.h +++ b/trunk/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 */