summaryrefslogtreecommitdiff
path: root/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2004-11-07 22:24:32 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2004-11-07 22:24:32 +0000
commit58406bee8938178fc317574c4236434b0dd11a25 (patch)
treeb4fa34eca69e23769c548b4436cbf65d765e5fe2 /sysutils/nautilus-cd-burner/files/patch-cd-drive.c
parentAdd mbox (diff)
Presenting GNOME 2.8 for FreeBSD (2.8.1 to be exact).
This release notes detailing all of the new goodies in GNOME 2.8 can be found at http://www.gnome.org/start/2.8/notes/, and the list of what was fixed in GNOME 2.8.1 can be found at http://lists.gnome.org/archives/gnome-announce-list/2004-October/msg00056.html. This release, as well as all of our others, would not have been possible without the great efforts of our FreeBSD GNOME Team. The list of current members can be found at http://www.freebsd.org/gnome/contact.html (including our newest member, Michael Johnson <ahze@FreeBSD.org>). Special thanks also goes out to all of the loyal FreeBSD GNOME users that put up with crashes and hangs to test and debug GNOME on FreeBSD. We would especially like to thank those users that provided patches for GNOME 2.7 and 2.8: Franz Klammer <klammer@webonaut.com> Piotr Smyrak <piotr.smyrak@heron.pl> Radek Kozlowski <radek@raadradd.com> Khairil Yusof <kaeru@pd.jaring.my> Yasuda Keisuke <kysd@po.harenet.ne.jp> Tom McLaughlin <tmclaugh@sdf.lonestar.org> Vladimir Grebenschikov <vova@fbsd.ru> GNOME 2.8 also features a new, FreeBSD-specific splashscreen that was designed by jimmac for GNOME 2.8, then daemonized by Franz Klammer <klammer@webonaut.com> and Radek Kozlowski <radek@raadradd.com>. As with GNOME 2.6, you cannot just "portupgrade" to GNOME 2.8. There is a script provided at http://www.marcuscom.com/downloads/gnome_upgrade28.sh that will aid in the upgrade process. Full documentation on the GNOME 2.8 upgrade is coming following this commit. From all of us at FreeBSD GNOME, ENJOY!
Notes
Notes: svn path=/head/; revision=121068
Diffstat (limited to 'sysutils/nautilus-cd-burner/files/patch-cd-drive.c')
-rw-r--r--sysutils/nautilus-cd-burner/files/patch-cd-drive.c218
1 files changed, 218 insertions, 0 deletions
diff --git a/sysutils/nautilus-cd-burner/files/patch-cd-drive.c b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
new file mode 100644
index 000000000000..1bcf94f3e29b
--- /dev/null
+++ b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
@@ -0,0 +1,218 @@
+--- cd-drive.c.orig Wed Sep 22 09:20:04 2004
++++ cd-drive.c Mon Oct 4 02:20:47 2004
+@@ -270,9 +270,21 @@
+ {
+ int fd;
+ int mmc_profile;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
+
+ g_return_val_if_fail (device != NULL, CD_MEDIA_TYPE_ERROR);
+
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return CD_MEDIA_TYPE_ERROR;
++ }
++
++ fd = cam->fd;
++#else
++
+ fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
+ if (fd < 0) {
+ if (errno == EBUSY) {
+@@ -280,6 +292,7 @@
+ }
+ return CD_MEDIA_TYPE_ERROR;
+ }
++#endif
+
+ mmc_profile = get_mmc_profile (fd);
+
+@@ -307,7 +320,11 @@
+ }
+ }
+
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+
+ switch (mmc_profile) {
+ case -1:
+@@ -442,10 +459,21 @@
+ int secs;
+ int mmc_profile;
+ gint64 size;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
+
+ g_return_val_if_fail (device != NULL, CD_MEDIA_SIZE_UNKNOWN);
+
+ secs = 0;
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return CD_MEDIA_SIZE_UNKNOWN;
++ }
++
++ fd = cam->fd;
++#else
+
+ fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
+ if (fd < 0) {
+@@ -454,6 +482,7 @@
+ }
+ return CD_MEDIA_SIZE_UNKNOWN;
+ }
++#endif
+
+ mmc_profile = get_mmc_profile (fd);
+
+@@ -476,7 +505,11 @@
+ size = CD_MEDIA_SIZE_NA;
+ }
+
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+
+ return size;
+ }
+@@ -595,9 +628,81 @@
+ #endif /* USE_HAL */
+
+ #if defined(__linux__) || defined(__FreeBSD__)
++static int
++get_device_max_write_speed (char *device)
++{
++ int fd;
++ int max_speed;
++ int read_speed, write_speed;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
++
++ max_speed = -1;
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return -1;
++ }
++
++ fd = cam->fd;
++#else
++
++ fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
++ if (fd < 0) {
++ return -1;
++ }
++#endif
+
++ get_read_write_speed (fd, &read_speed, &write_speed);
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
++ close (fd);
++#endif
++ max_speed = (int)floor (write_speed) / CD_ROM_SPEED;
+
++ return max_speed;
++}
+
++#if !defined(__linux)
++static int
++get_device_max_read_speed (char *device)
++{
++ int fd;
++ int max_speed;
++ int read_speed, write_speed;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
++
++ max_speed = -1;
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return -1;
++ }
++
++ fd = cam->fd;
++#else
++
++ fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
++ if (fd < 0) {
++ return -1;
++ }
++#endif
++
++ get_read_write_speed (fd, &read_speed, &write_speed);
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
++ close (fd);
++#endif
++ max_speed = (int)floor (read_speed) / CD_ROM_SPEED;
++
++ return max_speed;
++}
++#endif
+ #endif /* __linux__ || __FreeBSD__ */
+
+ #if defined (__linux__)
+@@ -800,49 +905,7 @@
+ return NULL;
+ }
+
+-#if !defined(__linux)
+-static int
+-get_device_max_read_speed (char *device)
+-{
+- int fd;
+- int max_speed;
+- int read_speed, write_speed;
+
+- max_speed = -1;
+-
+- fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
+- if (fd < 0) {
+- return -1;
+- }
+-
+- get_read_write_speed (fd, &read_speed, &write_speed);
+- close (fd);
+- max_speed = (int)floor (read_speed) / CD_ROM_SPEED;
+-
+- return max_speed;
+-}
+-#endif
+-
+-static int
+-get_device_max_write_speed (char *device)
+-{
+- int fd;
+- int max_speed;
+- int read_speed, write_speed;
+-
+- max_speed = -1;
+-
+- fd = open (device, O_RDWR|O_EXCL|O_NONBLOCK);
+- if (fd < 0) {
+- return -1;
+- }
+-
+- get_read_write_speed (fd, &read_speed, &write_speed);
+- close (fd);
+- max_speed = (int)floor (write_speed) / CD_ROM_SPEED;
+-
+- return max_speed;
+-}
+
+ static char *
+ get_scsi_cd_name (int bus, int id, int lun, const char *dev,