[brasero] Set a maximum attempts at reprobing
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] Set a maximum attempts at reprobing
- Date: Mon, 24 Aug 2009 13:46:41 +0000 (UTC)
commit a66e43646941f6814cee99aff24d0720c497be80
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Sat Aug 22 16:05:26 2009 +0200
Set a maximum attempts at reprobing
libbrasero-burn/brasero-burn.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libbrasero-burn/brasero-burn.c b/libbrasero-burn/brasero-burn.c
index d6079d8..e1e11ce 100644
--- a/libbrasero-burn/brasero-burn.c
+++ b/libbrasero-burn/brasero-burn.c
@@ -145,6 +145,8 @@ static guint brasero_burn_signals [LAST_SIGNAL] = { 0 };
#define MAX_EJECT_ATTEMPTS 5
#define MAX_MOUNT_ATTEMPTS 40
+#define MAX_REPROBE_ATTEMPTS 80
+
#define MOUNT_TIMEOUT 500
static GObjectClass *parent_class = NULL;
@@ -257,6 +259,7 @@ brasero_burn_sleep (BraseroBurn *burn, gint msec)
static BraseroBurnResult
brasero_burn_reprobe (BraseroBurn *burn)
{
+ guint attempts = 0;
BraseroMedium *medium;
BraseroBurnPrivate *priv;
BraseroBurnResult result = BRASERO_BURN_OK;
@@ -267,8 +270,10 @@ brasero_burn_reprobe (BraseroBurn *burn)
/* reprobe the medium and wait for it to be probed */
brasero_drive_reprobe (priv->dest);
- while ((medium = brasero_drive_get_medium (priv->dest)) == NULL)
+ while (attempts < MAX_REPROBE_ATTEMPTS && (medium = brasero_drive_get_medium (priv->dest)) == NULL) {
result = brasero_burn_sleep (burn, 250);
+ attempts ++;
+ }
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]