From: Yu Watanabe Date: Thu, 10 May 2018 16:22:49 +0000 (+0900) Subject: core: send NULL instead of empty string X-Git-Tag: v239~276^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79a603758d3b46fa05a4588f0ca19648fa3601d6;p=thirdparty%2Fsystemd.git core: send NULL instead of empty string --- diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 23b98027d31..ff2dfa59d3f 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -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( diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index de6aaba2298..ced5d06bd4a 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -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( diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 4d168b240d6..f93893c62f2 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -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); }