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
=== modified file 'services/panel-service.c'
--- services/panel-service.c 2013-10-03 15:15:35 +0000
+++ services/panel-service.c 2013-10-16 21:06:41 +0000
@@ -35,6 +35,7 @@
3535
36#include <upstart.h>36#include <upstart.h>
37#include <nih/alloc.h>37#include <nih/alloc.h>
38#include <nih/error.h>
3839
39G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT);40G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT);
4041
@@ -154,7 +155,11 @@
154 event_sent = upstart_emit_event_sync (NULL, priv->upstart,155 event_sent = upstart_emit_event_sync (NULL, priv->upstart,
155 "indicator-services-end", NULL, 0);156 "indicator-services-end", NULL, 0);
156 if (event_sent != 0)157 if (event_sent != 0)
157 g_warning("Unable to signal for indicator services to start");158 {
159 NihError * err = nih_error_get();
160 g_warning("Unable to signal for indicator services to stop: %s", err->message);
161 nih_free(err);
162 }
158163
159 nih_unref (priv->upstart, NULL);164 nih_unref (priv->upstart, NULL);
160 priv->upstart = NULL;165 priv->upstart = NULL;
@@ -549,7 +554,11 @@
549 int event_sent = 0;554 int event_sent = 0;
550 event_sent = upstart_emit_event_sync (NULL, self->priv->upstart, "indicator-services-start", NULL, 0);555 event_sent = upstart_emit_event_sync (NULL, self->priv->upstart, "indicator-services-start", NULL, 0);
551 if (event_sent != 0)556 if (event_sent != 0)
552 g_warning ("Unable to signal for indicator services to start");557 {
558 NihError * err = nih_error_get();
559 g_warning("Unable to signal for indicator services to start: %s", err->message);
560 nih_free(err);
561 }
553 }562 }
554563
555 return FALSE;564 return FALSE;
@@ -681,6 +690,12 @@
681 NULL,690 NULL,
682 DBUS_PATH_UPSTART,691 DBUS_PATH_UPSTART,
683 NULL, NULL);692 NULL, NULL);
693 if (priv->upstart == NULL)
694 {
695 NihError * err = nih_error_get();
696 g_warning("Unable to get Upstart proxy: %s", err->message);
697 nih_free(err);
698 }
684 dbus_connection_unref (conn);699 dbus_connection_unref (conn);
685 }700 }
686 }701 }