diff options
author | mich <mich@FreeBSD.org> | 2008-01-02 21:51:57 +0800 |
---|---|---|
committer | mich <mich@FreeBSD.org> | 2008-01-02 21:51:57 +0800 |
commit | 210a39f21df6b6df5c2e0fe22dcaf640eb6ee1fd (patch) | |
tree | 0ed05b53a6d4e2b652682479a0b6cd4bb3f7ce67 /sysutils/libcdio | |
parent | 5f1172178ac854d7ca61454b76d5583da78643ed (diff) | |
download | freebsd-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.c | 41 | ||||
-rw-r--r-- | sysutils/libcdio/files/patch-lib_driver_FreeBSD_freebsd.h | 14 |
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); |