Kdbus upstream merge in progress
authorRadoslaw Pajak <r.pajak@samsung.com>
Tue, 10 Dec 2013 14:53:13 +0000 (15:53 +0100)
committerRadoslaw Pajak <r.pajak@samsung.com>
Tue, 10 Dec 2013 14:53:13 +0000 (15:53 +0100)
Fixed segfault when ListNames is called, but the method is still not working propoerly
(returns nothing).

Change-Id: I1c55b8efb99ba540e6547c0f0b2d5f713d385f98
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
bus/kdbus-d.c
dbus/kdbus-common.c
dbus/kdbus-common.h

index 2fdf587..e874b43 100644 (file)
@@ -564,7 +564,7 @@ dbus_bool_t kdbus_list_services (DBusConnection* connection, char ***listp, int
   cmd.flags = KDBUS_NAME_LIST_NAMES; //TODO add handling | KDBUS_NAME_LIST_UNIQUE;
 
 again:
   cmd.flags = KDBUS_NAME_LIST_NAMES; //TODO add handling | KDBUS_NAME_LIST_UNIQUE;
 
 again:
-       if(ioctl(fd, KDBUS_CMD_NAME_LIST, cmd))
+       if(ioctl(fd, KDBUS_CMD_NAME_LIST, &cmd))
        {
                if(errno == EINTR)
                        goto again;
        {
                if(errno == EINTR)
                        goto again;
@@ -580,6 +580,9 @@ again:
   for (name = name_list->names; (uint8_t *)(name) < (uint8_t *)(name_list) + name_list->size; name = KDBUS_PART_NEXT(name))
     list_len++;
 
   for (name = name_list->names; (uint8_t *)(name) < (uint8_t *)(name_list) + name_list->size; name = KDBUS_PART_NEXT(name))
     list_len++;
 
+  _dbus_verbose ("Name list size: %llu\n", name_list->size);
+  _dbus_verbose ("List len: %d\n", list_len);
+
   list = malloc(sizeof(char*) * (list_len + 1));
   if(list == NULL)
     goto out;
   list = malloc(sizeof(char*) * (list_len + 1));
   if(list == NULL)
     goto out;
index 2334ba7..d11edda 100644 (file)
@@ -174,7 +174,6 @@ int request_kdbus_name(int fd, const char *name, const __u64 flags, __u64 id)
 
   cmd_name->flags = flags_kdbus;
   cmd_name->id = id;
 
   cmd_name->flags = flags_kdbus;
   cmd_name->id = id;
-  //   cmd_name->conn_flags = 0;
 
   _dbus_verbose("Request name - flags sent: 0x%llx       !!!!!!!!!\n", cmd_name->flags);
 
 
   _dbus_verbose("Request name - flags sent: 0x%llx       !!!!!!!!!\n", cmd_name->flags);
 
index 656b25f..9958dd5 100644 (file)
@@ -36,7 +36,6 @@
        (typeof(part))(((uint8_t *)part) + KDBUS_ALIGN8((part)->size))
 #define KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE  0x00800000              /* maximum size of message header and items */
 #define KDBUS_PART_HEADER_SIZE          offsetof(struct kdbus_item, data)
        (typeof(part))(((uint8_t *)part) + KDBUS_ALIGN8((part)->size))
 #define KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE  0x00800000              /* maximum size of message header and items */
 #define KDBUS_PART_HEADER_SIZE          offsetof(struct kdbus_item, data)
-
 #define KDBUS_PART_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_PART_HEADER_SIZE)
 
 //todo restore if DBus policy will be applied in kdbus somehow
 #define KDBUS_PART_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_PART_HEADER_SIZE)
 
 //todo restore if DBus policy will be applied in kdbus somehow