From af80cd56e3b68cbc0de1fa1d03f9b2b2463aa514 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 3 Apr 2011 22:55:26 +0200 Subject: [PATCH] throw_error(): Print error to stderr when being called internally throw_error() immediately returns for Device methods which are called internally from the daemon (i. e. without an actual PolicyKit check), as we do not have a D-BUS invocation context. Print out the error message in this case as well. --- src/device.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/device.c b/src/device.c index 261e45e..14d323a 100644 --- a/src/device.c +++ b/src/device.c @@ -5281,13 +5281,16 @@ throw_error (DBusGMethodInvocation *context, va_list args; char *message; - if (context == NULL) - return TRUE; - va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); + if (context == NULL) + { + g_warning ("%s", message); + return TRUE; + } + error = g_error_new (ERROR, error_code, "%s", message); dbus_g_method_return_error (context, error); g_error_free (error); -- 2.7.4