aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/libcdio
diff options
context:
space:
mode:
authormich <mich@FreeBSD.org>2008-01-02 21:51:57 +0800
committermich <mich@FreeBSD.org>2008-01-02 21:51:57 +0800
commit210a39f21df6b6df5c2e0fe22dcaf640eb6ee1fd (patch)
tree0ed05b53a6d4e2b652682479a0b6cd4bb3f7ce67 /sysutils/libcdio
parent5f1172178ac854d7ca61454b76d5583da78643ed (diff)
downloadfreebsd-ports-gnome-210a39f21df6b6df5c2e0fe22dcaf640eb6ee1fd.tar.gz
freebsd-ports-gnome-210a39f21df6b6df5c2e0fe22dcaf640eb6ee1fd.tar.zst
freebsd-ports-gnome-210a39f21df6b6df5c2e0fe22dcaf640eb6ee1fd.zip
- add get_media_changed method drives accessed via CAM(SCSI/ATAPICAM)
Submitted by: Andriy Gapon <avg@icyb.net.ua>
Diffstat (limited to 'sysutils/libcdio')
-rw-r--r--sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.c41
-rw-r--r--sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.h14
2 files changed, 55 insertions, 0 deletions
diff --git a/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.c b/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.c
new file mode 100644
index 000000000000..9b2435b1c20d
--- /dev/null
+++ b/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.c
@@ -0,0 +1,41 @@
+
+$FreeBSD$
+
+--- lib/driver/FreeBSD/freebsd.c.orig
++++ lib/driver/FreeBSD/freebsd.c
+@@ -743,6 +743,27 @@
+ #endif /*HAVE_FREEBSD_CDROM*/
+ }
+
++/*! Find out if media has changed since the last call. @param
++ p_user_data the environment of the CD object to be acted upon.
++ @return 1 if media has changed since last call, 0 if not. Error
++ return codes are the same as driver_return_code_t
++ */
++int
++get_media_changed_freebsd (const void *p_user_data)
++{
++#ifdef HAVE_FREEBSD_CDROM
++ const _img_private_t *p_env = p_user_data;
++ if ( p_env->access_mode == _AM_CAM ) {
++ return mmc_get_media_changed( p_env->gen.cdio );
++ }
++ else
++ return DRIVER_OP_UNSUPPORTED;
++#else
++ return DRIVER_OP_NO_DRIVER;
++#endif /*HAVE_FREEBSD_CDROM*/
++}
++
++
+ /*!
+ Initialization routine. This is the only thing that doesn't
+ get called via a function pointer. In fact *we* are the
+@@ -790,6 +811,7 @@
+ .get_discmode = get_discmode_generic,
+ .get_drive_cap = get_drive_cap_freebsd,
+ .get_first_track_num = get_first_track_num_generic,
++ .get_media_changed = get_media_changed_freebsd,
+ .get_mcn = get_mcn_freebsd,
+ .get_num_tracks = get_num_tracks_generic,
+ .get_track_channels = get_track_channels_generic,
diff --git a/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.h b/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.h
new file mode 100644
index 000000000000..89d23c58614c
--- /dev/null
+++ b/sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.h
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- lib/driver/FreeBSD/freebsd.h.orig
++++ lib/driver/FreeBSD/freebsd.h
+@@ -158,6 +158,8 @@
+ cdio_drive_write_cap_t *p_write_cap,
+ cdio_drive_misc_cap_t *p_misc_cap);
+
++int get_media_changed_freebsd (const void *p_user_data);
++
+ char *get_mcn_freebsd_ioctl (const _img_private_t *p_env);
+
+ void free_freebsd_cam (void *obj);