Merge lp:~charlesk/indicator-datetime/lp-1384714-silence-wakeup-warning into lp:indicator-datetime/15.04

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 390
Merged at revision: 389
Proposed branch: lp:~charlesk/indicator-datetime/lp-1384714-silence-wakeup-warning
Merge into: lp:indicator-datetime/15.04
Diff against target: 18 lines (+6/-1)
1 file modified
src/wakeup-timer-powerd.cpp (+6/-1)
To merge this branch: bzr merge lp:~charlesk/indicator-datetime/lp-1384714-silence-wakeup-warning
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+240596@code.launchpad.net

Commit message

Don't log an error if powerd isn't available on the system.

Description of the change

Don't log an error if powerd isn't available on the system: we don't need it for desktop, which is where this error message is getting logged, so it's okay to fail silently.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

I think we need a comment on why that error is being ignored in the source code.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
390. By Charles Kerr

add a comment explaining why it's okay to let that fail silently.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/wakeup-timer-powerd.cpp'
--- src/wakeup-timer-powerd.cpp 2014-09-19 14:34:50 +0000
+++ src/wakeup-timer-powerd.cpp 2014-11-04 18:27:51 +0000
@@ -192,8 +192,13 @@
192 ret = g_dbus_connection_call_finish(G_DBUS_CONNECTION(o), res, &error);192 ret = g_dbus_connection_call_finish(G_DBUS_CONNECTION(o), res, &error);
193 if (ret == nullptr)193 if (ret == nullptr)
194 {194 {
195 if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))195 /* powerd isn't on the desktop, but we don't need hardware wakeups there
196 anyway... so no need to warn on SERVICE_UNKNOWN */
197 if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
198 !g_error_matches(error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))
199 {
196 g_warning("%s Could not set hardware wakeup: %s", G_STRLOC, error->message);200 g_warning("%s Could not set hardware wakeup: %s", G_STRLOC, error->message);
201 }
197 }202 }
198 else203 else
199 {204 {

Subscribers

People subscribed via source and target branches