From e732a46a997bd4104b788870ccf39dcb3fbaf8b3 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Thu, 11 Sep 2014 17:32:42 +0200 Subject: [PATCH] connection: reformat --- connection.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/connection.c b/connection.c index 5013de2..b190118 100644 --- a/connection.c +++ b/connection.c @@ -1200,20 +1200,21 @@ int kdbus_cmd_conn_update(struct kdbus_conn *conn, if (flags_provided) conn->attach_flags = attach_flags; - if (!policy_provided) - return 0; + if (policy_provided) { + if (!conn->bus->policy_db) { + ret = kdbus_policy_db_new(&conn->bus->policy_db); + if (ret < 0) + return ret; + } - if (!conn->bus->policy_db) { - ret = kdbus_policy_db_new(&conn->bus->policy_db); + ret = kdbus_policy_set(conn->bus->policy_db, cmd->items, + KDBUS_ITEMS_SIZE(cmd, items), + 1, false, conn); if (ret < 0) return ret; } - ret = kdbus_policy_set(conn->bus->policy_db, cmd->items, - KDBUS_ITEMS_SIZE(cmd, items), - 1, false, conn); - - return ret; + return 0; } /** -- 2.34.1