All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH v3 1/4] dbus: Add AddMatch and RemoveMatch support
Date: Thu, 19 Feb 2015 09:21:28 -0600	[thread overview]
Message-ID: <54E5FF78.5070109@gmail.com> (raw)
In-Reply-To: <1424275716-7198-2-git-send-email-jukka.rissanen@linux.intel.com>

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

Hi Jukka,

On 02/18/2015 10:08 AM, Jukka Rissanen wrote:
> We do not check for errors as they are typically unrecoverable
> in this case and in most cases ignored anyway.
>
> This is the comment from libdbus API documentation for
> dbus_bus_add_match() about error checking:
>
> "If you pass NULL for the error, this function will not block;
> the match thus won't be added until you flush the connection,
> and if there's an error adding the match you won't find out
> about it. This is generally acceptable, since the possible
> errors (including a lack of resources in the bus, the connection
> having exceeded its quota of active match rules, or the match
> rule being unparseable) are generally unrecoverable."
> ---
>   ell/dbus.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
>

Mostly fine with this one, but please tweak the naming to be consistent 
with what we already have.

> diff --git a/ell/dbus.c b/ell/dbus.c
> index 4c4ba2d..c10e0ed 100644
> --- a/ell/dbus.c
> +++ b/ell/dbus.c
> @@ -1227,3 +1227,29 @@ LIB_EXPORT bool l_dbus_unregister_interface(struct l_dbus *dbus,
>
>   	return _dbus_object_tree_unregister(dbus->tree, path, interface);
>   }
> +
> +static void send_match(struct l_dbus *dbus, const char *rule,
> +						const char *method)

So dbus1_send_match

> +{
> +	struct l_dbus_message *message;
> +
> +	message = l_dbus_message_new_method_call(dbus,
> +						DBUS_SERVICE_DBUS,
> +						DBUS_PATH_DBUS,
> +						DBUS_INTERFACE_DBUS,
> +						method);
> +
> +	l_dbus_message_set_arguments(message, "s", rule);
> +
> +	send_message(dbus, false, message, NULL, NULL, NULL);
> +}
> +
> +static void _dbus_bus_add_match(struct l_dbus *dbus, const char *rule)

The '_' prefix is reserved to exported functions that are private. 
Since this function is static, do not use the '_' prefix.

dbus1_bus_add_match

> +{
> +	send_match(dbus, rule, "AddMatch");
> +}
> +
> +static void _dbus_bus_remove_match(struct l_dbus *dbus, const char *rule)
> +{

dbus1_remove_match

> +	send_match(dbus, rule, "RemoveMatch");
> +}
>

Regards,
-Denis

  reply	other threads:[~2015-02-19 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 16:08 [PATCH v3 0/4] Add DBus disconnect watch support Jukka Rissanen
2015-02-18 16:08 ` [PATCH v3 1/4] dbus: Add AddMatch and RemoveMatch support Jukka Rissanen
2015-02-19 15:21   ` Denis Kenzior [this message]
2015-02-18 16:08 ` [PATCH v3 2/4] gvariant: dbus.h need to be included before private header Jukka Rissanen
2015-02-18 16:08 ` [PATCH v3 3/4] dbus: Add disconnect watch support Jukka Rissanen
2015-02-19 15:57   ` Denis Kenzior
2015-02-18 16:08 ` [PATCH v3 4/4] unit: dbus: Add test for disconnect watch API Jukka Rissanen
2015-02-19 16:07   ` Denis Kenzior

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=54E5FF78.5070109@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.