Merge lp:~robert-ancell/lightdm/dbus-logging into lp:lightdm

Proposed by Robert Ancell
Status: Merged
Approved by: Robert Ancell
Approved revision: 1765
Merged at revision: 1767
Proposed branch: lp:~robert-ancell/lightdm/dbus-logging
Merge into: lp:lightdm
Diff against target: 134 lines (+47/-26)
1 file modified
src/lightdm.c (+47/-26)
To merge this branch: bzr merge lp:~robert-ancell/lightdm/dbus-logging
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+182015@code.launchpad.net

Commit message

Log D-Bus error messages

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1765
http://jenkins.qa.ubuntu.com/job/lightdm-ci/184/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/lightdm-saucy-amd64-ci/101

Click here to trigger a rebuild:
http://s-jenkins:8080/job/lightdm-ci/184/rebuild

review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lightdm.c'
2--- src/lightdm.c 2013-08-24 03:33:06 +0000
3+++ src/lightdm.c 2013-08-26 00:50:40 +0000
4@@ -509,16 +509,19 @@
5 bus_entry_free (gpointer data)
6 {
7 BusEntry *entry = data;
8+ GError *error = NULL;
9
10 g_dbus_connection_unregister_object (bus, entry->bus_id);
11
12- g_dbus_connection_emit_signal (bus,
13- NULL,
14- "/org/freedesktop/DisplayManager",
15- "org.freedesktop.DisplayManager",
16- entry->removed_signal,
17- g_variant_new ("(o)", entry->path),
18- NULL);
19+ if (!g_dbus_connection_emit_signal (bus,
20+ NULL,
21+ "/org/freedesktop/DisplayManager",
22+ "org.freedesktop.DisplayManager",
23+ entry->removed_signal,
24+ g_variant_new ("(o)", entry->path),
25+ &error))
26+ g_warning ("Failed to emit %s signal: %s", entry->removed_signal, error->message);
27+ g_clear_error (&error);
28
29 g_free (entry->path);
30 g_free (entry->parent_path);
31@@ -536,6 +539,7 @@
32 };
33 BusEntry *seat_entry, *entry;
34 gchar *path;
35+ GError *error = NULL;
36
37 /* Set environment variables when session runs */
38 seat_entry = g_hash_table_lookup (seat_bus_entries, seat);
39@@ -556,14 +560,20 @@
40 session_info->interfaces[0],
41 &session_vtable,
42 g_object_ref (session), g_object_unref,
43- NULL);
44- g_dbus_connection_emit_signal (bus,
45- NULL,
46- "/org/freedesktop/DisplayManager",
47- "org.freedesktop.DisplayManager",
48- "SessionAdded",
49- g_variant_new ("(o)", entry->path),
50- NULL);
51+ &error);
52+ if (entry->bus_id == 0)
53+ g_warning ("Failed to register user session: %s", error->message);
54+ g_clear_error (&error);
55+
56+ if (!g_dbus_connection_emit_signal (bus,
57+ NULL,
58+ "/org/freedesktop/DisplayManager",
59+ "org.freedesktop.DisplayManager",
60+ "SessionAdded",
61+ g_variant_new ("(o)", entry->path),
62+ &error))
63+ g_warning ("Failed to emit SessionAdded signal: %s", error->message);
64+ g_clear_error (&error);
65 }
66
67 static void
68@@ -583,6 +593,7 @@
69 };
70 gchar *path;
71 BusEntry *entry;
72+ GError *error = NULL;
73
74 path = g_strdup_printf ("/org/freedesktop/DisplayManager/Seat%d", seat_index);
75 seat_index++;
76@@ -598,14 +609,20 @@
77 seat_info->interfaces[0],
78 &seat_vtable,
79 g_object_ref (seat), g_object_unref,
80- NULL);
81- g_dbus_connection_emit_signal (bus,
82- NULL,
83- "/org/freedesktop/DisplayManager",
84- "org.freedesktop.DisplayManager",
85- "SeatAdded",
86- g_variant_new ("(o)", entry->path),
87- NULL);
88+ &error);
89+ if (entry->bus_id == 0)
90+ g_warning ("Failed to register seat: %s", error->message);
91+ g_clear_error (&error);
92+
93+ if (!g_dbus_connection_emit_signal (bus,
94+ NULL,
95+ "/org/freedesktop/DisplayManager",
96+ "org.freedesktop.DisplayManager",
97+ "SeatAdded",
98+ g_variant_new ("(o)", entry->path),
99+ &error))
100+ g_warning ("Failed to emit SeatAdded signal: %s", error->message);
101+ g_clear_error (&error);
102
103 g_signal_connect (seat, "running-user-session", G_CALLBACK (running_user_session_cb), NULL);
104 g_signal_connect (seat, "session-removed", G_CALLBACK (session_removed_cb), NULL);
105@@ -707,6 +724,7 @@
106 "</node>";
107 GDBusNodeInfo *display_manager_info;
108 GList *link;
109+ GError *error = NULL;
110
111 g_debug ("Acquired bus name %s", name);
112
113@@ -724,8 +742,11 @@
114 display_manager_info->interfaces[0],
115 &display_manager_vtable,
116 NULL, NULL,
117- NULL);
118- g_dbus_node_info_unref (display_manager_info);
119+ &error);
120+ if (bus_id == 0)
121+ g_warning ("Failed to register display manager: %s", error->message);
122+ g_clear_error (&error);
123+ g_dbus_node_info_unref (display_manager_info);
124
125 seat_bus_entries = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, bus_entry_free);
126 session_bus_entries = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, bus_entry_free);
127@@ -813,7 +834,7 @@
128 g_free (path);
129 }
130 else
131- g_warning ("Can't start VNC server, Xvn is not in the path");
132+ g_warning ("Can't start VNC server, Xvnc is not in the path");
133 }
134 }
135

Subscribers

People subscribed via source and target branches