[goobox] goobox can't find CD device ("Invalid device")



commit a4becbcb4a36f3964c7f06a065ad62e7cfa81db4
Author: Peter De Wachter <pdewacht gmail com>
Date:   Sat Sep 26 21:22:22 2009 +0200

    goobox can't find CD device ("Invalid device")
    
    [debian bug #547723]

 src/cd-drive.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/cd-drive.c b/src/cd-drive.c
index 9c490f5..232cb71 100644
--- a/src/cd-drive.c
+++ b/src/cd-drive.c
@@ -1065,13 +1065,13 @@ linux_scan (gboolean recorder_only)
 		device_str = read_lines ("/proc/scsi/sg/device_strs");
 		if (device_str == NULL) {
 			g_warning ("Can't read /proc/scsi/sg/device_strs");
-			g_strfreev (devices);
-			return NULL;
+			scsi_units = NULL;
+			n_scsi_units = 0;
+		} else {
+			scsi_units = g_new0 (struct scsi_unit, n_scsi_units);
+			get_scsi_units (device_str, devices, scsi_units);
 		}
 
-		scsi_units = g_new0 (struct scsi_unit, n_scsi_units);
-		get_scsi_units (device_str, devices, scsi_units);
-
 		g_strfreev (device_str);
 		g_strfreev (devices);
 	} else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]