Magellan Linux

Annotation of /trunk/hal/patches/hal-0.5.10-switch-probe-net-bluetooth-to-use-changesets.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (hide annotations) (download)
Mon May 19 19:05:19 2008 UTC (16 years ago) by niro
File size: 2497 byte(s)
-gentoo patches

1 niro 597 From c2b8e0dc03f70d6158f42aa4cd7098ad3da44c13 Mon Sep 17 00:00:00 2001
2     From: Guillem Jover <guillem.jover@nokia.com>
3     Date: Tue, 20 Nov 2007 15:36:20 +0100
4     Subject: [PATCH] switch probe-net-bluetooth to use changesets
5    
6     Switch probe-net-bluetooth to use changesets.
7     ---
8     hald/linux/probing/probe-net-bluetooth.c | 22 +++++++++++++++++-----
9     1 files changed, 17 insertions(+), 5 deletions(-)
10    
11     diff --git a/hald/linux/probing/probe-net-bluetooth.c b/hald/linux/probing/probe-net-bluetooth.c
12     index 69ddb0a..ec4cd25 100644
13     --- a/hald/linux/probing/probe-net-bluetooth.c
14     +++ b/hald/linux/probing/probe-net-bluetooth.c
15     @@ -41,8 +41,8 @@
16     #define BLUEZ_NET_SERVER_IFACE "org.bluez.network.Server"
17    
18     static void
19     -get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi,
20     - const char *id, const char *path)
21     +get_properties (DBusConnection *conn, LibHalChangeSet *cs,
22     + const char *id, const char *path)
23     {
24     DBusMessage *msg;
25     DBusMessage *reply = NULL;
26     @@ -100,7 +100,7 @@ get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi,
27    
28     HAL_INFO (("reply: %s:%s", key, value));
29    
30     - libhal_device_set_property_string (ctx, udi, prop, value, &error);
31     + libhal_changeset_set_property_string (cs, prop, value);
32     break;
33     }
34     case DBUS_TYPE_INT32:
35     @@ -111,7 +111,7 @@ get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi,
36    
37     HAL_INFO (("reply: %s:%d", key, value));
38    
39     - libhal_device_set_property_int (ctx, udi, prop, value, &error);
40     + libhal_changeset_set_property_int (cs, prop, value);
41     break;
42     }
43     default:
44     @@ -138,6 +138,7 @@ main (int argc, char *argv[])
45     char network[8] = "network";
46     const char *pnetwork = network;
47     LibHalContext *ctx = NULL;
48     + LibHalChangeSet *cs = NULL;
49     DBusConnection *conn;
50     DBusMessage *msg = NULL;
51     DBusMessage *reply = NULL;
52     @@ -217,13 +218,24 @@ main (int argc, char *argv[])
53     if (ctx == NULL)
54     goto out;
55    
56     - get_properties (conn, ctx, udi, id, connection);
57     + cs = libhal_device_new_changeset (udi);
58     + if (cs == NULL) {
59     + HAL_ERROR(("Cannot initialize changeset"));
60     + goto out;
61     + }
62     +
63     + get_properties (conn, cs, id, connection);
64    
65     out:
66     if (msg)
67     dbus_message_unref (msg);
68     if (reply)
69     dbus_message_unref (reply);
70     + if (cs != NULL) {
71     + dbus_error_init (&error);
72     + libhal_device_commit_changeset (ctx, cs, &error);
73     + libhal_device_free_changeset (cs);
74     + }
75     if (ctx != NULL) {
76     dbus_error_init (&error);
77     libhal_ctx_shutdown (ctx, &error);
78     --
79     1.5.3.7
80