summaryrefslogtreecommitdiff
path: root/legacy/eeze
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-08-02 07:06:31 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-08-02 07:06:31 +0000
commit917ce85269720db28316a0e38bb87af58cb1de55 (patch)
treee147a657816ae37411a4c6d828bafdaca818c896 /legacy/eeze
parente0cec4d456881441b216b5f34721255fecb8663a (diff)
revert remaining broken/wrong mount timeout behavior added recently
SVN revision: 74785
Diffstat (limited to 'legacy/eeze')
-rw-r--r--legacy/eeze/src/lib/eeze_disk.c5
-rw-r--r--legacy/eeze/src/lib/eeze_disk_mount.c66
-rw-r--r--legacy/eeze/src/lib/eeze_disk_private.h2
3 files changed, 5 insertions, 68 deletions
diff --git a/legacy/eeze/src/lib/eeze_disk.c b/legacy/eeze/src/lib/eeze_disk.c
index 722f47c023..8d1aeec52d 100644
--- a/legacy/eeze/src/lib/eeze_disk.c
+++ b/legacy/eeze/src/lib/eeze_disk.c
@@ -283,11 +283,6 @@ eeze_disk_free(Eeze_Disk *disk)
283 if (disk->mounter) ecore_exe_kill(disk->mounter); 283 if (disk->mounter) ecore_exe_kill(disk->mounter);
284 _eeze_disks = eina_list_remove(_eeze_disks, disk); 284 _eeze_disks = eina_list_remove(_eeze_disks, disk);
285 eeze_events = eina_list_remove(eeze_events, disk); 285 eeze_events = eina_list_remove(eeze_events, disk);
286 if (disk->mount_fail_delay)
287 {
288 ecore_timer_del(disk->mount_fail_delay);
289 disk->mount_fail_delay = NULL;
290 }
291 free(disk); 286 free(disk);
292} 287}
293 288
diff --git a/legacy/eeze/src/lib/eeze_disk_mount.c b/legacy/eeze/src/lib/eeze_disk_mount.c
index 4c9b7f2ed9..24c0ae4ebb 100644
--- a/legacy/eeze/src/lib/eeze_disk_mount.c
+++ b/legacy/eeze/src/lib/eeze_disk_mount.c
@@ -48,11 +48,6 @@ _eeze_disk_mount_error_handler(Eeze_Disk *disk, const char *error)
48 if (!(de = calloc(1, sizeof(Eeze_Event_Disk_Error)))) 48 if (!(de = calloc(1, sizeof(Eeze_Event_Disk_Error))))
49 return; 49 return;
50 50
51 if (disk->mount_fail_delay)
52 {
53 ecore_timer_del(disk->mount_fail_delay);
54 disk->mount_fail_delay = NULL;
55 }
56 de->disk = disk; 51 de->disk = disk;
57 de->message = eina_stringshare_add(error); 52 de->message = eina_stringshare_add(error);
58 /* FIXME: placeholder since currently there are only mount-type errors */ 53 /* FIXME: placeholder since currently there are only mount-type errors */
@@ -60,38 +55,6 @@ _eeze_disk_mount_error_handler(Eeze_Disk *disk, const char *error)
60} 55}
61 56
62static Eina_Bool 57static Eina_Bool
63_eeze_disk_mount_fail_delay_check(void *data)
64{
65 Eeze_Disk *disk = data;
66
67 disk->fail_pol_check++;
68 if (eeze_disk_mounted_get(disk))
69 {
70 Eeze_Event_Disk_Mount *e;
71
72 disk->mounted = EINA_TRUE;
73 e = malloc(sizeof(Eeze_Event_Disk_Mount));
74 if (e)
75 {
76 e->disk = disk;
77 ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
78 }
79 return EINA_FALSE;
80 }
81 if (disk->fail_pol_check > 30)
82 {
83 if (disk->mount_fail_delay)
84 {
85 ecore_timer_del(disk->mount_fail_delay);
86 disk->mount_fail_delay = NULL;
87 }
88 _eeze_disk_mount_error_handler(disk, "mount failure");
89 return EINA_FALSE;
90 }
91 return EINA_TRUE;
92}
93
94static Eina_Bool
95_eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecore_Exe_Event_Del *ev) 58_eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecore_Exe_Event_Del *ev)
96{ 59{
97 Eeze_Disk *disk; 60 Eeze_Disk *disk;
@@ -116,25 +79,11 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
116 disk->mounter = NULL; 79 disk->mounter = NULL;
117 if (!ev->exit_code) 80 if (!ev->exit_code)
118 { 81 {
119 if (!eeze_disk_mounted_get(disk)) 82 disk->mounted = EINA_TRUE;
120 { 83 e = malloc(sizeof(Eeze_Event_Disk_Mount));
121 /* libmount seems to have a nasty race condition... or 84 EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
122 * mount .. or something... the mount exe returns 85 e->disk = disk;
123 * BUT its not mounted yet! so poll for a bit.. and see */ 86 ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
124 if (!disk->mount_fail_delay)
125 disk->mount_fail_delay =
126 ecore_timer_add(0.1, _eeze_disk_mount_fail_delay_check,
127 disk);
128 disk->fail_pol_check = 0;
129 }
130 else
131 {
132 disk->mounted = EINA_TRUE;
133 e = malloc(sizeof(Eeze_Event_Disk_Mount));
134 EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
135 e->disk = disk;
136 ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
137 }
138 } 87 }
139 else if (ev->exit_code & 2) 88 else if (ev->exit_code & 2)
140 _eeze_disk_mount_error_handler(disk, "system error (out of memory, cannot fork, no more loop devices)"); 89 _eeze_disk_mount_error_handler(disk, "system error (out of memory, cannot fork, no more loop devices)");
@@ -472,11 +421,6 @@ eeze_disk_cancel(Eeze_Disk *disk)
472 disk->mount_status = EEZE_DISK_NULL; 421 disk->mount_status = EEZE_DISK_NULL;
473 ecore_exe_kill(disk->mounter); 422 ecore_exe_kill(disk->mounter);
474 disk->mounter = NULL; 423 disk->mounter = NULL;
475 if (disk->mount_fail_delay)
476 {
477 ecore_timer_del(disk->mount_fail_delay);
478 disk->mount_fail_delay = NULL;
479 }
480} 424}
481 425
482EAPI const char * 426EAPI const char *
diff --git a/legacy/eeze/src/lib/eeze_disk_private.h b/legacy/eeze/src/lib/eeze_disk_private.h
index 85fcd690cd..0174b9e30d 100644
--- a/legacy/eeze/src/lib/eeze_disk_private.h
+++ b/legacy/eeze/src/lib/eeze_disk_private.h
@@ -51,9 +51,7 @@ struct _Eeze_Disk
51 Eina_Bool unmount_cmd_changed : 1; 51 Eina_Bool unmount_cmd_changed : 1;
52 Eina_Bool mounted : 1; 52 Eina_Bool mounted : 1;
53 Ecore_Exe *mounter; 53 Ecore_Exe *mounter;
54 Ecore_Timer *mount_fail_delay;
55 unsigned int mount_fail_count; 54 unsigned int mount_fail_count;
56 int fail_pol_check;
57 55
58 const char *syspath; 56 const char *syspath;
59 const char *devpath; 57 const char *devpath;