diff options
-rw-r--r-- | daemon/gvfsbackendafc.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c index 3169b792..942deae5 100644 --- a/daemon/gvfsbackendafc.c +++ b/daemon/gvfsbackendafc.c @@ -90,70 +90,6 @@ struct _GVfsBackendAfc { GMutex apps_lock; }; -struct afc_error_mapping { - afc_error_t from; - GIOErrorEnum to; -}; - -static struct afc_error_mapping afc_error_to_g_io_error[] = { - { AFC_E_UNKNOWN_ERROR , G_IO_ERROR_FAILED }, - { AFC_E_OP_HEADER_INVALID , G_IO_ERROR_FAILED }, - { AFC_E_NO_RESOURCES , G_IO_ERROR_TOO_MANY_OPEN_FILES }, - { AFC_E_READ_ERROR , G_IO_ERROR_NOT_DIRECTORY }, - { AFC_E_WRITE_ERROR , G_IO_ERROR_FAILED }, - { AFC_E_UNKNOWN_PACKET_TYPE , G_IO_ERROR_FAILED }, - { AFC_E_INVALID_ARG , G_IO_ERROR_INVALID_ARGUMENT }, - { AFC_E_OBJECT_NOT_FOUND , G_IO_ERROR_NOT_FOUND }, - { AFC_E_OBJECT_IS_DIR , G_IO_ERROR_IS_DIRECTORY }, - { AFC_E_DIR_NOT_EMPTY , G_IO_ERROR_NOT_EMPTY }, - { AFC_E_PERM_DENIED , G_IO_ERROR_PERMISSION_DENIED }, - { AFC_E_SERVICE_NOT_CONNECTED , G_IO_ERROR_HOST_NOT_FOUND }, - { AFC_E_OP_TIMEOUT , G_IO_ERROR_TIMED_OUT }, - { AFC_E_TOO_MUCH_DATA , G_IO_ERROR_FAILED }, - { AFC_E_END_OF_DATA , G_IO_ERROR_FAILED }, - { AFC_E_OP_NOT_SUPPORTED , G_IO_ERROR_NOT_SUPPORTED }, - { AFC_E_OBJECT_EXISTS , G_IO_ERROR_EXISTS }, - { AFC_E_OBJECT_BUSY , G_IO_ERROR_BUSY }, - { AFC_E_NO_SPACE_LEFT , G_IO_ERROR_NO_SPACE }, - { AFC_E_OP_WOULD_BLOCK , G_IO_ERROR_WOULD_BLOCK }, - { AFC_E_IO_ERROR , G_IO_ERROR_FAILED }, - { AFC_E_OP_INTERRUPTED , G_IO_ERROR_CANCELLED }, - { AFC_E_OP_IN_PROGRESS , G_IO_ERROR_PENDING }, - { AFC_E_INTERNAL_ERROR , G_IO_ERROR_FAILED }, - { AFC_E_NOT_ENOUGH_DATA , G_IO_ERROR_CLOSED }, - { AFC_E_MUX_ERROR , G_IO_ERROR_FAILED }, - { -1 } -}; - -/** - * Tries to convert the AFC error value into a GIOError. - * - * @param client AFC client to retrieve status value from. - * - * @return errno value. - */ -static GIOErrorEnum -g_io_error_from_afc_error (afc_error_t error) -{ - GIOErrorEnum res = G_IO_ERROR_FAILED; - int i = 0; gboolean found = FALSE; - - while (afc_error_to_g_io_error[i++].from != -1) - { - if (afc_error_to_g_io_error[i].from == error) - { - res = afc_error_to_g_io_error[i++].to; - found = TRUE; - break; - } - } - - if (!found) - g_message ("Unknown AFC error (%d).\n", error); - - return res; -} - G_DEFINE_TYPE(GVfsBackendAfc, g_vfs_backend_afc, G_VFS_TYPE_BACKEND) static void |