summaryrefslogtreecommitdiff
path: root/sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2005-03-12 10:39:38 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2005-03-12 10:39:38 +0000
commit190418a078b1eb7ea3c5d38a08bdab3cbd422086 (patch)
treebb336ccecde7052d26d3d8d8c97238744a373aad /sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c
parentUpdate to 6300d. (diff)
Presenting GNOME 2.10 for FreeBSD!
The release notes can be found at http://www.gnome.org/start/2.10/notes/rnwhatsnew.html, and will give you a good idea of what has gone into this release overall. However, a lot of FreeBSD specific additions and fixes have been made. For example, this release offers fixed ACPI support as well as new CPU freqeuncy monitoring support. See the FreeBSD GNOME 2.10 upgrade page at http://www.FreeBSD.org/gnome/docs/faq210.html for the entire list as well as a list of known issues and upgrade instructions. GNOME 2.10, as well as all of our releases, would not be possible without the great team that goes into porting and testign each and every component. Thanks definitely goes out to ahze, adamw, bland, kwm, mezz, and pav for all their work. We would also like to thank our adventurous users that chose to ride the walrus. We'd especially like to thank the following users that provided patches for GNOME 2.10: ade Yasuda Keisuke Franz Klammer Khairil Yusof Radek Kozlowsk And anyone else I may have accidentally omitted. As with GNOME 2.8, 2.10 comes with a brand-spankin' new splashscreen courtesy of Franz Klammer. However, unlike GNOME 2.8, we've included all of the FreeBSD GNOME splashscreen entries with gnomesession. You can use the deskutils/splashsetter port to choose the one you like best. As always, GNOME users should _not_ use portupgrade alone to upgrade to 2.10. Instead, get the gnome_upgrade.sh script from http://www.FreeBSD.org/gnome/gnome_upgrade.sh. Enjoy!
Diffstat (limited to 'sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c')
-rw-r--r--sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c276
1 files changed, 276 insertions, 0 deletions
diff --git a/sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c b/sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c
new file mode 100644
index 000000000000..c2299e5721cb
--- /dev/null
+++ b/sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c
@@ -0,0 +1,276 @@
+--- nautilus-burn-drive.c.orig Tue Feb 22 19:34:17 2005
++++ nautilus-burn-drive.c Tue Mar 1 00:46:50 2005
+@@ -62,6 +62,13 @@
+
+ #define CD_ROM_SPEED 176
+
++#if !defined(__linux)
++static int get_device_max_read_speed (char *device);
++#endif
++#if defined(__linux__) || defined(__FreeBSD__)
++static int get_device_max_write_speed (char *device);
++#endif
++
+ static struct {
+ const char *name;
+ gboolean can_write_cdr;
+@@ -149,7 +156,7 @@
+ int *max_wr_speed,
+ NautilusBurnDriveType *type)
+ {
+- char *stdout_data, *rd_speed, *wr_speed, *drive_cap;
++ char *stdout_data, *drive_cap;
+
+ *max_rd_speed = -1;
+ *max_wr_speed = -1;
+@@ -278,6 +285,9 @@
+ {
+ int fd;
+ int mmc_profile;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
+
+ g_return_val_if_fail (device != NULL, NAUTILUS_BURN_MEDIA_TYPE_ERROR);
+
+@@ -286,6 +296,15 @@
+ if (has_data) *has_data = FALSE;
+ if (has_audio) *has_audio = FALSE;
+
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return NAUTILUS_BURN_MEDIA_TYPE_ERROR;
++ }
++
++ fd = cam->fd;
++#else
++
+ if ((fd = open (device, O_RDWR | O_EXCL | O_NONBLOCK)) < 0
+ && (fd = open (device, O_RDONLY | O_EXCL | O_NONBLOCK)) < 0) {
+ if (errno == EBUSY) {
+@@ -293,6 +312,7 @@
+ }
+ return NAUTILUS_BURN_MEDIA_TYPE_ERROR;
+ }
++#endif
+
+ mmc_profile = get_mmc_profile (fd);
+
+@@ -303,12 +323,20 @@
+ opened = nautilus_burn_drive_door_open (mmc_profile, fd);
+
+ if (opened != FALSE) {
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+ return NAUTILUS_BURN_MEDIA_TYPE_ERROR;
+ } else {
+ int blank, rewrite, empty;
+ if (get_disc_status (fd, &empty, &rewrite, &blank) == 0) {
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+
+ if (is_rewritable)
+ *is_rewritable = rewrite;
+@@ -325,12 +353,20 @@
+ else
+ return NAUTILUS_BURN_MEDIA_TYPE_UNKNOWN;
+ }
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+ return NAUTILUS_BURN_MEDIA_TYPE_UNKNOWN;
+ }
+ }
+
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+
+ if (is_blank)
+ *is_blank = mmc_profile & 0x10000;
+@@ -569,11 +605,21 @@
+ int secs;
+ int mmc_profile;
+ gint64 size;
++#ifdef __FreeBSD__
++ struct cam_device *cam;
++#endif
+
+ g_return_val_if_fail (device != NULL, NAUTILUS_BURN_MEDIA_SIZE_UNKNOWN);
+
+ secs = 0;
++#ifdef __FreeBSD__
++ cam = cam_open_device (device, O_RDWR);
++ if (cam == NULL) {
++ return NAUTILUS_BURN_MEDIA_SIZE_UNKNOWN;
++ }
+
++ fd = cam->fd;
++#else
+ if ((fd = open (device, O_RDWR | O_EXCL | O_NONBLOCK)) < 0
+ && (fd = open (device, O_RDONLY | O_EXCL | O_NONBLOCK)) < 0) {
+ if (errno == EBUSY) {
+@@ -581,6 +627,7 @@
+ }
+ return NAUTILUS_BURN_MEDIA_SIZE_UNKNOWN;
+ }
++#endif
+
+ mmc_profile = get_mmc_profile (fd);
+
+@@ -603,7 +650,11 @@
+ size = NAUTILUS_BURN_MEDIA_SIZE_NA;
+ }
+
++#ifdef __FreeBSD__
++ cam_close_device (cam);
++#else
+ close (fd);
++#endif
+
+ return size;
+ }
+@@ -896,9 +947,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__)
+@@ -1111,50 +1234,6 @@
+ }
+ }
+ 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;
+-
+- if ((fd = open (device, O_RDWR | O_EXCL | O_NONBLOCK)) < 0
+- && (fd = open (device, O_RDONLY | O_EXCL | O_NONBLOCK)) < 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;
+-
+- if ((fd = open (device, O_RDWR | O_EXCL | O_NONBLOCK)) < 0
+- && (fd = open (device, O_RDONLY | O_EXCL | O_NONBLOCK)) < 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 *