public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Less errors from the cups backend
@ 2009-06-24 17:03 Bastien Nocera
  2009-06-27 10:26 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Bastien Nocera @ 2009-06-24 17:03 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 108 bytes --]

Avoids filling up /var/log/messages, as seen in:
https://bugzilla.redhat.com/show_bug.cgi?id=507572

Cheers

[-- Attachment #2: 0001-Less-errors-from-the-cups-backend.patch --]
[-- Type: text/x-patch, Size: 1253 bytes --]

>From c260d9aa469347bc11c6b61944bf130deb6a2e04 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 24 Jun 2009 18:01:27 +0100
Subject: [PATCH] Less errors from the cups backend

Don't error out when either D-Bus isn't available,
bluetoothd isn't running, or there's no adapters.
---
 cups/main.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/cups/main.c b/cups/main.c
index 6dcc622..2fbfe7e 100644
--- a/cups/main.c
+++ b/cups/main.c
@@ -536,15 +536,15 @@ static gboolean list_printers(void)
 
 	conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);
 	if (conn == NULL)
-		return FALSE;
+		return TRUE;
 
 	dbus_error_init(&error);
 	hcid_exists = dbus_bus_name_has_owner(conn, "org.bluez", &error);
 	if (&error != NULL && dbus_error_is_set(&error))
-		return FALSE;
+		return TRUE;
 
 	if (!hcid_exists)
-		return FALSE;
+		return TRUE;
 
 	/* Get the default adapter */
 	message = dbus_message_new_method_call("org.bluez", "/",
@@ -562,7 +562,8 @@ static gboolean list_printers(void)
 
 	if (&error != NULL && dbus_error_is_set(&error)) {
 		dbus_connection_unref(conn);
-		return FALSE;
+		/* No adapter */
+		return TRUE;
 	}
 
 	dbus_message_iter_init(reply, &reply_iter);
-- 
1.6.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-27 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24 17:03 [PATCH] Less errors from the cups backend Bastien Nocera
2009-06-27 10:26 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox