Revert "Use -T for eject(1) on optical drives"
authorDavid Zeuthen <davidz@redhat.com>
Fri, 12 Aug 2011 14:09:54 +0000 (10:09 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Fri, 12 Aug 2011 14:09:54 +0000 (10:09 -0400)
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
src/udiskslinuxdrive.c

index be71e0a..4a5b21c 100644 (file)
         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. <quote>It is now safe to remove
-        the device</quote>. If called on a drive with an open tray,
-        the "tray close" command may be sent if the hardware supports
-        it.
+        the device</quote>.
     -->
     <method name="Eject">
       <arg name="options" direction="in" type="a{sv}"/>
index 4671fe1..16c54d3 100644 (file)
@@ -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,