From 2f7455e32bb90dc31bbeaaa01e64a9767c2a16ae Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 12 Aug 2011 10:09:54 -0400 Subject: [PATCH] Revert "Use -T for eject(1) on optical drives" This causes failures on my optical drive that can't close its tray. We can probably do this by adding a Drive:CloseTray() method as well as a Drive:TrayIsOpen property... This reverts commit 51255b864c09390a96f49ed14a70916eb75b6456. --- data/org.freedesktop.UDisks2.xml | 4 +--- src/udiskslinuxdrive.c | 27 +-------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml index be71e0a..4a5b21c 100644 --- a/data/org.freedesktop.UDisks2.xml +++ b/data/org.freedesktop.UDisks2.xml @@ -175,9 +175,7 @@ other hardware may simply eject the disc. On some hardware it may not do anything physical but it may cause e.g. a display on the hardware to show e.g. It is now safe to remove - the device. If called on a drive with an open tray, - the "tray close" command may be sent if the hardware supports - it. + the device. --> diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c index 4671fe1..16c54d3 100644 --- a/src/udiskslinuxdrive.c +++ b/src/udiskslinuxdrive.c @@ -654,14 +654,10 @@ on_eject (UDisksDrive *drive_iface, UDisksDaemon *daemon; const gchar *action_id; gchar *error_message; - gboolean is_cdrom; - const gchar *const *media_compat; - guint n; daemon = NULL; block = NULL; error_message = NULL; - is_cdrom = FALSE; daemon = udisks_linux_drive_get_daemon (drive); block_object = find_block_object (drive); @@ -689,33 +685,12 @@ on_eject (UDisksDrive *drive_iface, invocation)) goto out; - /* Check if CD drive and, if so, use -T to support opening/closing - * the tray - * - * From the eject(1) man page - * - * With this option the drive is given a CD-ROM tray close command - * if it's opened, and a CD-ROM tray eject command if it's - * closed. Not all devices support this command, because it uses - * the above CD-ROM tray close command. - */ - media_compat = udisks_drive_get_media_compatibility (drive_iface); - for (n = 0; media_compat != NULL && media_compat[n] != NULL; n++) - { - if (g_str_has_prefix (media_compat[n], "optical")) - { - is_cdrom = TRUE; - break; - } - } - if (!udisks_daemon_launch_spawned_job_sync (daemon, NULL, /* GCancellable */ 0, /* uid_t run_as */ &error_message, NULL, /* input_string */ - "eject %s\"%s\"", - is_cdrom ? "-T " : "", + "eject \"%s\"", udisks_block_device_get_device (block))) { g_dbus_method_invocation_return_error (invocation, -- 2.7.4