From: Kay Sievers Date: Mon, 4 Aug 2014 14:18:08 +0000 (+0200) Subject: use conn->type instead of conn->flags where possible X-Git-Tag: upstream/0.20140911.160207utc~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=419166844240515e380fd90e00373783e5aa6b89;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git use conn->type instead of conn->flags where possible --- diff --git a/connection.c b/connection.c index 71bb66a..c2d71a8 100644 --- a/connection.c +++ b/connection.c @@ -1248,7 +1248,8 @@ int kdbus_conn_kmsg_send(struct kdbus_ep *ep, * Activator connections will not receive any * broadcast messages. */ - if (conn_dst->flags & KDBUS_HELLO_ACTIVATOR) + if (conn_dst->type != KDBUS_CONN_CONNECTED && + conn_dst->type != KDBUS_CONN_MONITOR) continue; if (!kdbus_match_db_match_kmsg(conn_dst->match_db, @@ -1287,7 +1288,7 @@ int kdbus_conn_kmsg_send(struct kdbus_ep *ep, conn_dst = kdbus_conn_ref(entry->conn); if ((msg->flags & KDBUS_MSG_FLAGS_NO_AUTO_START) && - (conn_dst->flags & KDBUS_HELLO_ACTIVATOR)) { + (conn_dst->type == KDBUS_CONN_ACTIVATOR)) { ret = -EADDRNOTAVAIL; goto exit_unref; } diff --git a/names.c b/names.c index aeedd6f..78c5455 100644 --- a/names.c +++ b/names.c @@ -314,7 +314,7 @@ void kdbus_name_remove_by_conn(struct kdbus_name_registry *reg, list_splice_init(&conn->names_queue_list, &names_queue_list); mutex_unlock(&conn->lock); - if (conn->flags & KDBUS_HELLO_ACTIVATOR) { + if (conn->type == KDBUS_CONN_ACTIVATOR) { activator = conn->activator_of->activator; conn->activator_of->activator = NULL; } @@ -494,7 +494,7 @@ int kdbus_name_acquire(struct kdbus_name_registry *reg, goto exit_unlock; } - if (conn->flags & KDBUS_HELLO_ACTIVATOR) { + if (conn->type == KDBUS_CONN_ACTIVATOR) { /* An activator can only own a single name */ if (conn->activator_of) { if (conn->activator_of == e) @@ -560,7 +560,7 @@ int kdbus_name_acquire(struct kdbus_name_registry *reg, goto exit_unlock; } else { /* An activator can only own a single name */ - if ((conn->flags & KDBUS_HELLO_ACTIVATOR) && + if ((conn->type == KDBUS_CONN_ACTIVATOR) && conn->activator_of) { ret = -EINVAL; goto exit_unlock; @@ -581,7 +581,7 @@ int kdbus_name_acquire(struct kdbus_name_registry *reg, goto exit_unlock; } - if (conn->flags & KDBUS_HELLO_ACTIVATOR) { + if (conn->type & KDBUS_CONN_ACTIVATOR) { e->activator = kdbus_conn_ref(conn); conn->activator_of = e; } @@ -764,7 +764,7 @@ static int kdbus_name_list_all(struct kdbus_conn *conn, u64 flags, /* skip activators */ if (!(flags & KDBUS_NAME_LIST_ACTIVATORS) && - c->flags & KDBUS_HELLO_ACTIVATOR) + c->type == KDBUS_CONN_ACTIVATOR) continue; /* all names the connection owns */ @@ -786,7 +786,7 @@ static int kdbus_name_list_all(struct kdbus_conn *conn, u64 flags, } if (flags & KDBUS_NAME_LIST_NAMES || - c->flags & KDBUS_HELLO_ACTIVATOR) { + c->type == KDBUS_CONN_ACTIVATOR) { ret = kdbus_name_list_write(conn, c, slice, &p, e, write); if (ret < 0)