summaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2003-05-21 15:01:08 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2003-05-21 15:01:08 +0800
commita68008e5594c00527ed3d262d1cf288352a03659 (patch)
tree050caa01a34aed5860d872cbcdc4ba3995832b90 /sysutils
parent0925dee37c8aaeeaf684c6e0c6b9ffd082e63f69 (diff)
downloadmarcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar.gz
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar.bz2
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar.lz
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar.xz
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.tar.zst
marcuscom-ports-a68008e5594c00527ed3d262d1cf288352a03659.zip
* Clean up the FreeBSD code to be more inline with the going style
* Make the freebsd_scan() function static just like the Linux version * Correct a logic mistake where by normal CD drives would be added to the list of recorders * Make sure to increment i even if we can't open the CD device. This prevents an infinite loop git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@786 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.c45
2 files changed, 25 insertions, 22 deletions
diff --git a/sysutils/nautilus-cd-burner/Makefile b/sysutils/nautilus-cd-burner/Makefile
index b089266d6..8ef7144f7 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= 1
+PORTREVISION= 2
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 452a930fc..871e134b7 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 Tue May 20 22:57:34 2003
++++ cd-drive.c Wed May 21 02:56:21 2003
@@ -40,6 +40,12 @@
#include <scsi/sg.h>
#endif /* __linux__ */
@@ -13,54 +13,57 @@
#include <glib.h>
#include <libgnome/gnome-i18n.h>
-@@ -603,6 +609,69 @@
+@@ -603,6 +609,72 @@
}
#endif /* __linux__ */
+#ifdef __FreeBSD__
-+GList *
++static GList *
+freebsd_scan (gboolean recorder_only)
+{
++ GList *cdroms_list = NULL;
+ const char *dev_type = "cd";
+ int fd;
+ int i = 0;
-+ GList *cdroms_list = NULL;
+
-+ while(1) {
-+ gchar *dev = g_strdup_printf("/dev/%s%dc", dev_type, i);
-+ int rspeed, wspeed;
++ while (1) {
+ CDDriveType type = CDDRIVE_TYPE_CD_RECORDER;
+ CDDrive *cdrom;
+ 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);
++ 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);
++ if ((cam_dev = cam_open_spec_device (dev_type, i, O_RDWR, NULL)) == NULL) {
++ g_free (dev);
++ i++;
+ continue;
+ }
+
-+ if ((fd = open(dev, O_RDWR, 0)) < 0) {
-+ g_free(dev);
++ if ((fd = open (dev, O_RDWR, 0)) < 0) {
++ g_free (dev);
++ free (cam_dev);
++ i++;
+ continue;
+ }
+
-+ if (ioctl(fd, CDRIOCWRITESPEED, &wspeed) < 0) {
++ if (ioctl (fd, CDRIOCWRITESPEED, &wspeed) < 0) {
+ wspeed = 0;
+ type = CDDRIVE_TYPE_CD_DRIVE;
+ }
+
-+ if (ioctl(fd, CDRIOCREADSPEED, &rspeed) < 0) {
++ if (ioctl (fd, CDRIOCREADSPEED, &rspeed) < 0) {
+ rspeed = 0;
+ }
+
-+ if (type == CDDRIVE_TYPE_CD_RECORDER || recorder_only) {
++ 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->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->cdrecord_id = g_strdup_printf ("%d,%d,%d", cam_dev->bus_id, cam_dev->target_id, cam_dev->target_lun);
@@ -69,8 +72,8 @@
+ cdroms_list = g_list_append (cdroms_list, cdrom);
+ }
+
-+ g_free(dev);
-+ free(cam_dev);
++ g_free (dev);
++ free (cam_dev);
+
+ i++;
+ }
@@ -83,7 +86,7 @@
GList *
scan_for_cdroms (gboolean recorder_only, gboolean add_image)
{
-@@ -611,6 +680,10 @@
+@@ -611,6 +683,10 @@
#ifdef __linux__
cdroms = linux_scan (recorder_only);