chiark / gitweb /
bus_util: add support to map double (#3479)
authorSusant Sahani <ssahani@users.noreply.github.com>
Thu, 9 Jun 2016 15:41:35 +0000 (21:11 +0530)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:59 +0000 (10:12 +0200)
Now we don't support parsing double at map_basic.
when trying to  use bus_message_map_all_properties with a double
this fails. Let's add it.

src/shared/bus-util.c

index def4324891ef4054a7de60fc62ecf9207f1c4b8c..12b091cebe446ca1e1b31f82c07bcbc26685db90 100644 (file)
@@ -1089,6 +1089,19 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_
                 break;
         }
 
+        case SD_BUS_TYPE_DOUBLE: {
+                double d;
+                double *p = userdata;
+
+                r = sd_bus_message_read_basic(m, type, &d);
+                if (r < 0)
+                        break;
+
+                *p = d;
+
+                break;
+        }
+
         default:
                 break;
         }