summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2010-06-02 15:56:07 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2010-06-02 15:59:47 +0200
commitca93d4e2d9e7f483b2fde1725da086e2cca44164 (patch)
tree570824f469320feec397a8689797956717031fa2
parentd1e50d1af0458230bdd5cd904ebf40f7600801ec (diff)
Fix long hangs on probing nonexistant floppy drives
A lot of modern machines do not have a floppy drive any more, but still have a floppy controller somewhere (or at least the BIOS pretends to). Trying to open(/dev/fd0) on these machines causes long hangs, which lead to long desktop startup times. To fix this, avoid probing floppies for media in update_info(). https://launchpad.net/bugs/539515
-rw-r--r--src/device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 763385c..0e87f1d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4471,7 +4471,8 @@ update_info (Device *device)
{
media_available = FALSE;
- if (!g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM"))
+ if (!g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM") &&
+ !g_udev_device_get_property_as_boolean (device->priv->d, "ID_DRIVE_FLOPPY"))
{
int fd;
fd = open (device->priv->device_file, O_RDONLY);