core: send NULL instead of empty string

This commit is contained in:
Yu Watanabe 2018-05-11 01:22:49 +09:00
parent 9d5527f26e
commit 79a603758d
3 changed files with 5 additions and 7 deletions

View 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(

View 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(

View 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);
}