{
/* update_info_mount_state() will update the mounts file and clean up the directory if needed */
update_info (device);
- dbus_g_method_return (context);
+ if (context != NULL)
+ dbus_g_method_return (context);
}
else
{
action_id = NULL;
if (!mount_file_has_device (device->priv->device_file, &uid_of_mount, NULL))
{
- if (!is_device_in_fstab (device, NULL))
+ if (context != NULL && !is_device_in_fstab (device, NULL))
{
action_id = "org.freedesktop.udisks.filesystem-unmount-others";
}
{
uid_t uid;
daemon_local_get_uid (device->priv->daemon, &uid, context);
- if (uid_of_mount != uid)
+ if (context != NULL && uid_of_mount != uid)
{
action_id = "org.freedesktop.udisks.filesystem-unmount-others";
}
if (WEXITSTATUS (status) == 0 && !job_was_cancelled)
{
/* TODO: probably wait for has_media to change to FALSE */
- dbus_g_method_return (context);
+ if (context != NULL)
+ dbus_g_method_return (context);
}
else
{
if (device_local_is_busy (device, TRUE, &error))
{
- dbus_g_method_return_error (context, error);
+ throw_error (context, ERROR_BUSY, error->message);
g_error_free (error);
goto out;
}
daemon_local_check_auth (device->priv->daemon,
device,
- "org.freedesktop.udisks.drive-eject",
+ context ? "org.freedesktop.udisks.drive-eject" : NULL,
"DriveEject",
TRUE,
device_drive_eject_authorized_cb,