* Connection Manager
*
* Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
- * Copyright (C) 2010 BMW Car IT GmbH. All rights reserved.
+ * Copyright (C) 2010,2012-2014 BMW Car IT GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
va_end(ap);
}
-
static void append(DBusMessageIter *dict, const char *pattern)
{
DBusMessageIter entry;
reason = getenv("script_type");
if (!busname || !interface || !path || !reason) {
- print("Required environment variables not set");
+ print("Required environment variables not set; "
+ "bus=%s iface=%s path=%s reason=%s",
+ busname, interface, path, reason);
ret = 1;
goto out;
}
dbus_error_init(&error);
conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
- if (conn == NULL) {
- if (dbus_error_is_set(&error) == TRUE) {
+ if (!conn) {
+ if (dbus_error_is_set(&error)) {
print("%s", error.message);
dbus_error_free(&error);
} else
msg = dbus_message_new_method_call(busname, path,
interface, "notify");
- if (msg == NULL) {
+ if (!msg) {
dbus_connection_unref(conn);
print("Failed to allocate method call");
goto out;
dbus_message_iter_close_container(&iter, &dict);
- if (dbus_connection_send(conn, msg, NULL) == FALSE) {
+ if (!dbus_connection_send(conn, msg, NULL)) {
print("Failed to send message");
goto out;
}