[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] [PATCH] fenced: send dbus signal when node is fenced



> +void dbus_init (void)

No space before (

Also, it would be a good idea to put a fenced-specific prefix before
fenced's own dbus functions, e.g. fd_dbus_init(), because dbus_ is the
dbus lib's namespace and open to symbol collisions.

> +{
> +#ifdef DBUS
> +
> +    if (!(bus = dbus_bus_get_private (DBUS_BUS_SYSTEM, NULL))) {
> +	log_error ("failed to get dbus connection");
> +    } else {
> +	log_debug ("connected to dbus %s", dbus_bus_get_unique_name (bus));
> +    }
> +
> +#endif
> +
> +    return;
> +}

It may be neater to put all of these functions under a single #ifdef DBUS
and then add empty stubs in an #else.

> +#ifdef DBUS
> +#include <dbus/dbus.h>
> +#endif

could that go in dbus.c?

> +	if (!optd_disable_dbus) {
> +		dbus_init();

In this case, the optd/cfgd pair is redundant, but technically this should
be testing the cfgd_disable_dbus value (the optd just indicates if the
option has been set on the command line).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]