]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: send NULL instead of empty string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 May 2018 16:22:49 +0000 (01:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 May 2018 16:22:49 +0000 (01:22 +0900)
src/core/dbus-execute.c
src/core/dbus-manager.c
src/core/dbus-unit.c

index 23b98027d31de9361e078d575119cd1494b337e9..ff2dfa59d3faf0821aef701a2a63438025153fef 100644 (file)
@@ -312,7 +312,7 @@ static int property_get_empty_string(
         assert(bus);
         assert(reply);
 
-        return sd_bus_message_append(reply, "s", "");
+        return sd_bus_message_append(reply, "s", NULL);
 }
 
 static int property_get_syscall_filter(
index de6aaba22981136b0a898478ce41abe38c7350d2..ced5d06bd4a8602928836e34a4cea88f701f37d9 100644 (file)
@@ -99,7 +99,7 @@ static int property_get_virtualization(
 
         return sd_bus_message_append(
                         reply, "s",
-                        v == VIRTUALIZATION_NONE ? "" : virtualization_to_string(v));
+                        v == VIRTUALIZATION_NONE ? NULL : virtualization_to_string(v));
 }
 
 static int property_get_architecture(
index 4d168b240d658bbf355c3984b997f946e15e816a..f93893c62f2f0a293b0e8f61884ad259be6e2e47 100644 (file)
@@ -81,7 +81,7 @@ static int property_get_following(
         assert(u);
 
         f = unit_following(u);
-        return sd_bus_message_append(reply, "s", f ? f->id : "");
+        return sd_bus_message_append(reply, "s", f ? f->id : NULL);
 }
 
 static int property_get_dependencies(
@@ -235,7 +235,7 @@ static int property_get_unit_file_preset(
         r = unit_get_unit_file_preset(u);
 
         return sd_bus_message_append(reply, "s",
-                                     r < 0 ? "":
+                                     r < 0 ? NULL:
                                      r > 0 ? "enabled" : "disabled");
 }
 
@@ -918,7 +918,7 @@ static int property_get_cgroup(
                 sd_bus_error *error) {
 
         Unit *u = userdata;
-        const char *t;
+        const char *t = NULL;
 
         assert(bus);
         assert(reply);
@@ -932,8 +932,6 @@ static int property_get_cgroup(
 
         if (u->cgroup_path)
                 t = isempty(u->cgroup_path) ? "/" : u->cgroup_path;
-        else
-                t = "";
 
         return sd_bus_message_append(reply, "s", t);
 }