[Wine-patches] [eterhack] mountmgr.sys: Fix working with DBusError.

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Чт Май 28 17:03:44 MSD 2009


----------- следующая часть -----------
From 4041a0698d91fc07f6f7ebf300313ff6a51ce70d Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Thu, 28 May 2009 15:08:18 +0400
Subject: [eterhack] mountmgr.sys: Fix working with DBusError.

---
 dlls/mountmgr.sys/hal.c |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/dlls/mountmgr.sys/hal.c b/dlls/mountmgr.sys/hal.c
index 8e066e5..df50ab0 100644
--- a/dlls/mountmgr.sys/hal.c
+++ b/dlls/mountmgr.sys/hal.c
@@ -136,35 +136,26 @@ static void new_device( LibHalContext *ctx, const char *udi )
     if (!p_libhal_device_get_property_bool( ctx, parent, "storage.removable", &error ))
         goto done;
 
-    if (!(bus = p_libhal_device_get_property_string( ctx, parent, "storage.bus", &error )))
-        p_dbus_error_free( &error );
-
+    bus = p_libhal_device_get_property_string( ctx, parent, "storage.bus", NULL );
     if (bus && !strcmp( bus, "usb" )) bus_type = BusTypeUsb;
     else bus_type = BusTypeUnknown;
 
-    if (!(type = p_libhal_device_get_property_string( ctx, parent, "storage.drive_type", &error )))
-        p_dbus_error_free( &error );  /* ignore error */
-
+    type = p_libhal_device_get_property_string( ctx, parent, "storage.drive_type", NULL );
     if (type && !strcmp( type, "cdrom" )) drive_type = DEVICE_CDROM;
     else if (type && !strcmp( type, "floppy" )) drive_type = DEVICE_FLOPPY;
     else if (type && !strcmp( type, "disk" )) drive_type = DEVICE_HARDDISK;
     else drive_type = DEVICE_UNKNOWN;
 
-    if (!(vendor = p_libhal_device_get_property_string( ctx, parent, "info.vendor", NULL )))
-        p_dbus_error_free( &error );
-
-    if (!(product = p_libhal_device_get_property_string( ctx, parent, "info.product", NULL )))
-        p_dbus_error_free( &error );
-
-    if (!(revision = p_libhal_device_get_property_string( ctx, parent, "storage.firmware_version", NULL )))
-        p_dbus_error_free( &error );
+    vendor = p_libhal_device_get_property_string( ctx, parent, "info.vendor", NULL );
+    product = p_libhal_device_get_property_string( ctx, parent, "info.product", NULL );
+    revision = p_libhal_device_get_property_string( ctx, parent, "storage.firmware_version", NULL );
 
     do {
         prev = p_libhal_device_get_property_string( ctx, parent, "info.parent", NULL );
-        if (!prev)
-            p_dbus_error_free( &error );
-        else
+        if (prev)
+        {
             serial = p_libhal_device_get_property_string( ctx, prev, "usb_device.serial", NULL );
+        }
         p_libhal_free_string( parent );
         parent = prev;
         prev = NULL;
-- 
1.6.3.1



Подробная информация о списке рассылки Wine-patches