summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-10-19 19:49:00 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-10-19 19:49:00 +0300
commit70a609bb3a7401b56377de77586e09a56d631468 (patch)
tree6e155f63090145b8d002bb47b6dee430b1c47a06
parentd24560cf46154b7364eeea8d9b3f77e50b6ee63a (diff)
sap: Fix connected property fetching when not connected
-rw-r--r--profiles/sap/server.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/profiles/sap/server.c b/profiles/sap/server.c
index 530f9946..bb37c18e 100644
--- a/profiles/sap/server.c
+++ b/profiles/sap/server.c
@@ -1295,11 +1295,15 @@ static gboolean server_property_get_connected(
struct sap_connection *conn = server->conn;
dbus_bool_t connected;
- if (!conn)
- return FALSE;
+ if (!conn) {
+ connected = FALSE;
+ goto append;
+ }
connected = (conn->state == SAP_STATE_CONNECTED ||
conn->state == SAP_STATE_GRACEFUL_DISCONNECT);
+
+append:
dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &connected);
return TRUE;