From: Martin Pitt Date: Wed, 10 Feb 2010 20:57:32 +0000 (+0100) Subject: Robustify evaluation of DM_SUSPEND X-Git-Tag: upstream/2.1.2~676 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1bcbb4c26436dd4f41fdfc9a7a603eaed00579f1;p=platform%2Fupstream%2Fudisks2.git Robustify evaluation of DM_SUSPEND If a DM device does not have DM_SUSPEND at all, do not consider it suspended. --- diff --git a/src/device.c b/src/device.c index 8bee920..65e14f6 100644 --- a/src/device.c +++ b/src/device.c @@ -4202,9 +4202,12 @@ update_info (Device *device) } /* ignore dm devices that are suspended */ - if (g_str_has_prefix (g_udev_device_get_name (device->priv->d), "dm-") && - g_strcmp0 (g_udev_device_get_property (device->priv->d, "DM_SUSPENDED"), "0") != 0) - goto out; + if (g_str_has_prefix (g_udev_device_get_name (device->priv->d), "dm-")) + { + s = g_udev_device_get_property (device->priv->d, "DM_SUSPENDED"); + if (s != NULL && strcmp (s, "0") != 0) + goto out; + } major = g_udev_device_get_property_as_int (device->priv->d, "MAJOR"); minor = g_udev_device_get_property_as_int (device->priv->d, "MINOR");