From: Martin Pitt Date: Sun, 3 Apr 2011 20:55:26 +0000 (+0200) Subject: throw_error(): Print error to stderr when being called internally X-Git-Tag: upstream/2.1.2~559 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af80cd56e3b68cbc0de1fa1d03f9b2b2463aa514;p=platform%2Fupstream%2Fudisks2.git 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. --- 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);