From 47e6294ca3d86c8425c814ee9c7d5186fc8849c1 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 21 Feb 2008 20:10:38 +0000 Subject: [PATCH] Testwise inquiry of ioctl(CDROM_MEDIA_CHANGED) (disabled by default) --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/sg-linux.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index dbacdfd1..5caacaf4 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2008.02.16.121102" +#define Cdrskin_timestamP "2008.02.21.200956" diff --git a/libburn/trunk/libburn/sg-linux.c b/libburn/trunk/libburn/sg-linux.c index 4a3b2362..8f70f7d7 100644 --- a/libburn/trunk/libburn/sg-linux.c +++ b/libburn/trunk/libburn/sg-linux.c @@ -308,6 +308,28 @@ static int sg_close_drive_fd(char *fname, int driveno, int *fd, int sorry) if(*fd < 0) return(0); + +#ifdef CDROM_MEDIA_CHANGED_disabled_because_not_helpful +#ifdef CDSL_CURRENT + /* ts A80217 : wondering whether the os knows about our activities */ + ret = ioctl(*fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT); + sprintf(msg, "ioctl(CDROM_MEDIA_CHANGED) == %d", ret); + libdax_msgs_submit(libdax_messenger, driveno, 0x00000002, + LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0); + +#ifdef BLKFLSBUF_disabled_because_not_helpful + ret = ioctl(*fd, BLKFLSBUF, 0); + sprintf(msg, "ioctl(BLKFLSBUF) == %d", ret); + os_errno = 0; + if(ret == -1) + os_errno = errno; + libdax_msgs_submit(libdax_messenger, driveno, 0x00000002, + LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg, os_errno,0); +#endif /* BLKFLSBUF */ + +#endif /* CDSL_CURRENT */ +#endif /* CDROM_MEDIA_CHANGED */ + ret = close(*fd); *fd = -1337; if(ret != -1) {