Merge lp:~ted/unity/nih-signals-complete into lp:unity

Proposed by Ted Gould
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3574
Proposed branch: lp:~ted/unity/nih-signals-complete
Merge into: lp:unity
Diff against target: 50 lines (+17/-2)
1 file modified
services/panel-service.c (+17/-2)
To merge this branch: bzr merge lp:~ted/unity/nih-signals-complete
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Stephen M. Webb (community) Approve
Review via email: mp+191457@code.launchpad.net

Commit message

Clean up NIH Errors so they don't get reported on exit.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Better message handling is always in good taste.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'services/panel-service.c'
2--- services/panel-service.c 2013-10-03 15:15:35 +0000
3+++ services/panel-service.c 2013-10-16 21:06:41 +0000
4@@ -35,6 +35,7 @@
5
6 #include <upstart.h>
7 #include <nih/alloc.h>
8+#include <nih/error.h>
9
10 G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT);
11
12@@ -154,7 +155,11 @@
13 event_sent = upstart_emit_event_sync (NULL, priv->upstart,
14 "indicator-services-end", NULL, 0);
15 if (event_sent != 0)
16- g_warning("Unable to signal for indicator services to start");
17+ {
18+ NihError * err = nih_error_get();
19+ g_warning("Unable to signal for indicator services to stop: %s", err->message);
20+ nih_free(err);
21+ }
22
23 nih_unref (priv->upstart, NULL);
24 priv->upstart = NULL;
25@@ -549,7 +554,11 @@
26 int event_sent = 0;
27 event_sent = upstart_emit_event_sync (NULL, self->priv->upstart, "indicator-services-start", NULL, 0);
28 if (event_sent != 0)
29- g_warning ("Unable to signal for indicator services to start");
30+ {
31+ NihError * err = nih_error_get();
32+ g_warning("Unable to signal for indicator services to start: %s", err->message);
33+ nih_free(err);
34+ }
35 }
36
37 return FALSE;
38@@ -681,6 +690,12 @@
39 NULL,
40 DBUS_PATH_UPSTART,
41 NULL, NULL);
42+ if (priv->upstart == NULL)
43+ {
44+ NihError * err = nih_error_get();
45+ g_warning("Unable to get Upstart proxy: %s", err->message);
46+ nih_free(err);
47+ }
48 dbus_connection_unref (conn);
49 }
50 }