summaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2003-05-22 06:39:25 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2003-05-22 06:39:25 +0800
commit2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58 (patch)
treeae7ab4301a2a1bad46d138bef4379493994c3b9b /sysutils
parent12d8e08dc2babb776029c875dda1f30c896a73d8 (diff)
downloadmarcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar.gz
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar.bz2
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar.lz
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar.xz
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.tar.zst
marcuscom-ports-2fb8c8d1c6e5981b3dfb9a12aec2fc29a8d78d58.zip
Yet another round of patches for the FreeBSD CD scanning code:
* CDRIOCWRITESPEED _sets_ the write speed, Joe. Instead, assume that we can do CDR_MAX_SPEED, and let the user figure it out * Make sure we open the acd* devices when dealing with ATAPI drives * Close the open device file descriptor git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@789 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/nautilus-cd-burner/Makefile2
-rw-r--r--sysutils/nautilus-cd-burner/files/patch-cd-drive.c30
2 files changed, 17 insertions, 15 deletions
diff --git a/sysutils/nautilus-cd-burner/Makefile b/sysutils/nautilus-cd-burner/Makefile
index 8ef7144f7..63054329b 100644
--- a/sysutils/nautilus-cd-burner/Makefile
+++ b/sysutils/nautilus-cd-burner/Makefile
@@ -7,7 +7,7 @@
PORTNAME= nautilus-cd-burner
PORTVERSION= 0.4.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= sysutils gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/0.4
diff --git a/sysutils/nautilus-cd-burner/files/patch-cd-drive.c b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
index 871e134b7..5a878e977 100644
--- a/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
+++ b/sysutils/nautilus-cd-burner/files/patch-cd-drive.c
@@ -1,5 +1,5 @@
--- cd-drive.c.orig Mon May 19 06:16:13 2003
-+++ cd-drive.c Wed May 21 02:56:21 2003
++++ cd-drive.c Wed May 21 18:21:29 2003
@@ -40,6 +40,12 @@
#include <scsi/sg.h>
#endif /* __linux__ */
@@ -13,7 +13,7 @@
#include <glib.h>
#include <libgnome/gnome-i18n.h>
-@@ -603,6 +609,72 @@
+@@ -603,6 +609,74 @@
}
#endif /* __linux__ */
@@ -24,26 +24,31 @@
+ GList *cdroms_list = NULL;
+ const char *dev_type = "cd";
+ int fd;
++ int speed = CDR_MAX_SPEED;
+ int i = 0;
+
+ while (1) {
+ CDDriveType type = CDDRIVE_TYPE_CD_RECORDER;
+ CDDrive *cdrom;
++ gchar *dev;
+ struct cam_device *cam_dev;
-+ gchar *dev = g_strdup_printf ("/dev/%s%dc", dev_type, i);
-+ int rspeed, wspeed;
+
+ if (!g_file_test (dev, G_FILE_TEST_EXISTS)) {
-+ g_free (dev);
+ break;
+ }
+
+ if ((cam_dev = cam_open_spec_device (dev_type, i, O_RDWR, NULL)) == NULL) {
-+ g_free (dev);
+ i++;
+ continue;
+ }
+
++ /* XXX Other controllers might need to be added. */
++ if ((strncmp (cam_dev->sim_name, "ata", 3)) == 0) {
++ dev = g_strdup_printf ("/dev/a%s%dc", dev_type, i);
++ } else {
++ dev = g_strdup_printf ("/dev/%s%dc", dev_type, i);
++ }
++
+ if ((fd = open (dev, O_RDWR, 0)) < 0) {
+ g_free (dev);
+ free (cam_dev);
@@ -51,21 +56,18 @@
+ continue;
+ }
+
-+ if (ioctl (fd, CDRIOCWRITESPEED, &wspeed) < 0) {
-+ wspeed = 0;
++ if (ioctl (fd, CDRIOCWRITESPEED, &speed) < 0) {
+ type = CDDRIVE_TYPE_CD_DRIVE;
+ }
+
-+ if (ioctl (fd, CDRIOCREADSPEED, &rspeed) < 0) {
-+ rspeed = 0;
-+ }
++ close (fd);
+
+ if (type == CDDRIVE_TYPE_CD_RECORDER || recorder_only == FALSE) {
+ cdrom = g_new0 (CDDrive, 1);
+ cdrom->display_name = g_strdup_printf ("%s %s %s", cam_dev->inq_data.vendor, cam_dev->inq_data.product, cam_dev->inq_data.revision);
+ cdrom->device = g_strdup (dev);
-+ cdrom->max_speed_read = rspeed;
-+ cdrom->max_speed_write = wspeed;
++ cdrom->max_speed_read = CDR_MAX_SPEED;
++ cdrom->max_speed_write = CDR_MAX_SPEED;
+ cdrom->cdrecord_id = g_strdup_printf ("%d,%d,%d", cam_dev->bus_id, cam_dev->target_id, cam_dev->target_lun);
+ cdrom->type = type;
+
@@ -86,7 +88,7 @@
GList *
scan_for_cdroms (gboolean recorder_only, gboolean add_image)
{
-@@ -611,6 +683,10 @@
+@@ -611,6 +685,10 @@
#ifdef __linux__
cdroms = linux_scan (recorder_only);