eeze_disk_cancel for canceling pending operations

SVN revision: 59430
This commit is contained in:
Mike Blumenkrantz 2011-05-16 01:32:40 +00:00
parent 7561260963
commit 56b342ccc9
3 changed files with 25 additions and 0 deletions

View File

@ -1,4 +1,7 @@
2011-05-15 Mike Blumenkrantz (discomfitor/zmike)
+eeze_disk_cancel
Cancel the current pending mount/umount operation on a disk
-------------------------------------
+EEZE_DISK_MOUNTOPT_UID
Add a uid=%i mount option using getuid, NOT geteuid
--------------------------------------

View File

@ -301,6 +301,15 @@ EAPI Eina_Bool eeze_disk_mount(Eeze_Disk *disk);
*/
EAPI Eina_Bool eeze_disk_unmount(Eeze_Disk *disk);
/**
* @brief Cancel a pending operation on the disk
* @param disk The disk
*
* This function cancels the current pending operation on @p disk which was previously
* started with eeze_disk_mount or eeze_disk_unmount.
*/
EAPI void eeze_disk_cancel(Eeze_Disk *disk);
/**
* @brief Return the mount point of a disk
* @param disk The disk

View File

@ -68,6 +68,8 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
eeze_events = eina_list_remove_list(eeze_events, l);
if (disk->mount_status == EEZE_DISK_MOUNTING)
{
disk->mount_status = EEZE_DISK_NULL;
disk->mounter = NULL;
if (!ev->exit_code)
{
e = malloc(sizeof(Eeze_Event_Disk_Mount));
@ -97,6 +99,8 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
e = malloc(sizeof(Eeze_Event_Disk_Unmount));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW);
e->disk = disk;
disk->mount_status = EEZE_DISK_NULL;
disk->mounter = NULL;
ecore_event_add(EEZE_EVENT_DISK_UNMOUNT, e, NULL, NULL);
break;
@ -322,6 +326,15 @@ eeze_disk_unmount(Eeze_Disk *disk)
return EINA_TRUE;
}
EAPI void
eeze_disk_cancel(Eeze_Disk *disk)
{
EINA_SAFETY_ON_NULL_RETURN(disk);
if ((!disk->mount_status) || (!disk->mounter)) return;
disk->mount_status = EEZE_DISK_NULL;
ecore_exe_quit(disk->mounter);
}
EAPI const char *
eeze_disk_mount_point_get(Eeze_Disk *disk)
{