[brasero] Make the code checking the readiness of a drive stronger



commit 804b35a0604b12378c912cd22ef5159d8cff27c8
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sun Aug 23 14:37:50 2009 +0200

    Make the code checking the readiness of a drive stronger
    Once opened, only accept NOT READY errors from the drive otherwise abort

 libbrasero-media/brasero-medium.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libbrasero-media/brasero-medium.c b/libbrasero-media/brasero-medium.c
index 20cf758..2983cbf 100644
--- a/libbrasero-media/brasero-medium.c
+++ b/libbrasero-media/brasero-medium.c
@@ -2986,8 +2986,15 @@ brasero_medium_probe_thread (gpointer self)
 
 		/* NOTE: if we wanted to know the status we'd need to read the 
 		 * error code variable which is currently NULL */
-		while (brasero_spc1_test_unit_ready (handle, NULL) != BRASERO_SCSI_OK) {
-			sleep (1);
+		while (brasero_spc1_test_unit_ready (handle, &code) != BRASERO_SCSI_OK) {
+			if (code != BRASERO_SCSI_NOT_READY) {
+				priv->probe = NULL;
+				brasero_device_handle_close (handle);
+				BRASERO_MEDIA_LOG ("Device does not respond");
+				break;
+			}
+
+			sleep (2);
 
 			if (priv->probe_cancelled) {
 				priv->probe = NULL;



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