{
g_set_error (error,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_OPTION_NOT_PERMITTED,
"Malformed mount option `%s'",
option);
g_string_free (str, TRUE);
{
g_set_error (error,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_OPTION_NOT_PERMITTED,
"Mount option `%s' is not allowed",
option);
g_string_free (str, TRUE);
}
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_ALREADY_MOUNTED,
"Device %s is already mounted at %s.\n",
udisks_block_device_get_device (block),
str->str);
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_OPTION_NOT_PERMITTED,
"Unsupported option `%s'",
option);
goto out;
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_NOT_MOUNTED,
"Device `%s' is not mounted",
udisks_block_device_get_device (block));
goto out;
/* TODO: allow with special authorization (unmount-others) */
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_MOUNTED_BY_OTHER_USER,
"Cannot unmount filesystem at `%s' mounted by other user with uid %d",
mount_point,
mounted_by_uid);
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
- UDISKS_ERROR_FAILED,
+ UDISKS_ERROR_ALREADY_UNMOUNTING,
"Cannot unmount %s: Mount point `%s' is currently being unmounted",
udisks_block_device_get_device (block),
mount_point);
* @UDISKS_ERROR_ALREADY_CANCELLED: The operation has already been cancelled.
* @UDISKS_ERROR_NOT_AUTHORIZED: Not authorized to perform the requested operation.
* @UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN: Like %UDISKS_ERROR_NOT_AUTHORIZED but authorization can be obtained through e.g. authentication.
+ * @UDISKS_ERROR_ALREADY_MOUNTED: The device is already mounted.
+ * @UDISKS_ERROR_NOT_MOUNTED: The device is not mounted.
+ * @UDISKS_ERROR_OPTION_NOT_PERMITTED: Not permitted to use the requested option.
+ * @UDISKS_ERROR_MOUNTED_BY_OTHER_USER: The device is mounted by another user.
+ * @UDISKS_ERROR_ALREADY_UNMOUNTING: The device is already unmounting.
*
* Error codes for the #UDISKS_ERROR error domain and the
* corresponding D-Bus error names.
UDISKS_ERROR_CANCELLED, /* org.freedesktop.UDisks.Error.Cancelled */
UDISKS_ERROR_ALREADY_CANCELLED, /* org.freedesktop.UDisks.Error.AlreadyCancelled */
UDISKS_ERROR_NOT_AUTHORIZED, /* org.freedesktop.UDisks.Error.NotAuthorized */
- UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN /* org.freedesktop.UDisks.Error.NotAuthorizedCanObtain */
+ UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN, /* org.freedesktop.UDisks.Error.NotAuthorizedCanObtain */
+ UDISKS_ERROR_ALREADY_MOUNTED, /* org.freedesktop.UDisks.Error.AlreadyMounted */
+ UDISKS_ERROR_NOT_MOUNTED, /* org.freedesktop.UDisks.Error.NotMounted */
+ UDISKS_ERROR_OPTION_NOT_PERMITTED, /* org.freedesktop.UDisks.Error.OptionNotPermitted */
+ UDISKS_ERROR_MOUNTED_BY_OTHER_USER, /* org.freedesktop.UDisks.Error.MountedByOtherUser */
+ UDISKS_ERROR_ALREADY_UNMOUNTING /* org.freedesktop.UDisks.Error.AlreadyUnmounting */
} UDisksError;
-#define UDISKS_ERROR_NUM_ENTRIES (UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN + 1)
+#define UDISKS_ERROR_NUM_ENTRIES (UDISKS_ERROR_ALREADY_UNMOUNTING + 1)
G_END_DECLS
{UDISKS_ERROR_ALREADY_CANCELLED, "org.freedesktop.UDisks.Error.AlreadyCancelled"},
{UDISKS_ERROR_NOT_AUTHORIZED, "org.freedesktop.UDisks.Error.NotAuthorized"},
{UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN, "org.freedesktop.UDisks.Error.NotAuthorizedCanObtain"},
+ {UDISKS_ERROR_ALREADY_MOUNTED, "org.freedesktop.UDisks.Error.AlreadyMounted"},
+ {UDISKS_ERROR_NOT_MOUNTED, "org.freedesktop.UDisks.Error.NotMounted"},
+ {UDISKS_ERROR_OPTION_NOT_PERMITTED, "org.freedesktop.UDisks.Error.OptionNotPermitted"},
+ {UDISKS_ERROR_MOUNTED_BY_OTHER_USER, "org.freedesktop.UDisks.Error.MountedByOtherUser"},
+ {UDISKS_ERROR_ALREADY_UNMOUNTING, "org.freedesktop.UDisks.Error.AlreadyUnmounting"}
};
GQuark