revert remaining broken/wrong mount timeout behavior added recently

SVN revision: 74785
This commit is contained in:
Mike Blumenkrantz 2012-08-02 07:06:31 +00:00
parent e0cec4d456
commit 917ce85269
3 changed files with 5 additions and 68 deletions

View File

@ -283,11 +283,6 @@ eeze_disk_free(Eeze_Disk *disk)
if (disk->mounter) ecore_exe_kill(disk->mounter);
_eeze_disks = eina_list_remove(_eeze_disks, disk);
eeze_events = eina_list_remove(eeze_events, disk);
if (disk->mount_fail_delay)
{
ecore_timer_del(disk->mount_fail_delay);
disk->mount_fail_delay = NULL;
}
free(disk);
}

View File

@ -48,49 +48,12 @@ _eeze_disk_mount_error_handler(Eeze_Disk *disk, const char *error)
if (!(de = calloc(1, sizeof(Eeze_Event_Disk_Error))))
return;
if (disk->mount_fail_delay)
{
ecore_timer_del(disk->mount_fail_delay);
disk->mount_fail_delay = NULL;
}
de->disk = disk;
de->message = eina_stringshare_add(error);
/* FIXME: placeholder since currently there are only mount-type errors */
ecore_event_add(EEZE_EVENT_DISK_ERROR, de, (Ecore_End_Cb)_eeze_disk_mount_error_free, NULL);
}
static Eina_Bool
_eeze_disk_mount_fail_delay_check(void *data)
{
Eeze_Disk *disk = data;
disk->fail_pol_check++;
if (eeze_disk_mounted_get(disk))
{
Eeze_Event_Disk_Mount *e;
disk->mounted = EINA_TRUE;
e = malloc(sizeof(Eeze_Event_Disk_Mount));
if (e)
{
e->disk = disk;
ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
}
return EINA_FALSE;
}
if (disk->fail_pol_check > 30)
{
if (disk->mount_fail_delay)
{
ecore_timer_del(disk->mount_fail_delay);
disk->mount_fail_delay = NULL;
}
_eeze_disk_mount_error_handler(disk, "mount failure");
return EINA_FALSE;
}
return EINA_TRUE;
}
static Eina_Bool
_eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecore_Exe_Event_Del *ev)
{
@ -116,25 +79,11 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
disk->mounter = NULL;
if (!ev->exit_code)
{
if (!eeze_disk_mounted_get(disk))
{
/* libmount seems to have a nasty race condition... or
* mount .. or something... the mount exe returns
* BUT its not mounted yet! so poll for a bit.. and see */
if (!disk->mount_fail_delay)
disk->mount_fail_delay =
ecore_timer_add(0.1, _eeze_disk_mount_fail_delay_check,
disk);
disk->fail_pol_check = 0;
}
else
{
disk->mounted = EINA_TRUE;
e = malloc(sizeof(Eeze_Event_Disk_Mount));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
e->disk = disk;
ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
}
disk->mounted = EINA_TRUE;
e = malloc(sizeof(Eeze_Event_Disk_Mount));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
e->disk = disk;
ecore_event_add(EEZE_EVENT_DISK_MOUNT, e, NULL, NULL);
}
else if (ev->exit_code & 2)
_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)
disk->mount_status = EEZE_DISK_NULL;
ecore_exe_kill(disk->mounter);
disk->mounter = NULL;
if (disk->mount_fail_delay)
{
ecore_timer_del(disk->mount_fail_delay);
disk->mount_fail_delay = NULL;
}
}
EAPI const char *

View File

@ -51,9 +51,7 @@ struct _Eeze_Disk
Eina_Bool unmount_cmd_changed : 1;
Eina_Bool mounted : 1;
Ecore_Exe *mounter;
Ecore_Timer *mount_fail_delay;
unsigned int mount_fail_count;
int fail_pol_check;
const char *syspath;
const char *devpath;