From: Bastien Nocera <hadess@hadess.net>
To: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] Less errors from the cups backend
Date: Wed, 24 Jun 2009 18:03:46 +0100 [thread overview]
Message-ID: <1245863027.26486.17241.camel@localhost.localdomain> (raw)
[-- 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
next reply other threads:[~2009-06-24 17:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 17:03 Bastien Nocera [this message]
2009-06-27 10:26 ` [PATCH] Less errors from the cups backend Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245863027.26486.17241.camel@localhost.localdomain \
--to=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox