diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-10-26 17:26:27 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-12 14:27:19 +0100 |
commit | ecd48322c2fd11ccdeed971c45c611f001d0d7b8 (patch) | |
tree | 3a84c6da9f0623bfbefcd395eea34fc380a3c808 /src/core/dbus-mount.c | |
parent | core: make "tmpfs" dependencies on swapfs a "default" dep, not an "implicit" (diff) | |
download | systemd-ecd48322c2fd11ccdeed971c45c611f001d0d7b8.tar.xz systemd-ecd48322c2fd11ccdeed971c45c611f001d0d7b8.zip |
core: sd-bus can handle NULL strings nicely, let's use it
No need to set an empty string here, sd-bus serializes NULL as empty
string anway.
Diffstat (limited to '')
-rw-r--r-- | src/core/dbus-mount.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/dbus-mount.c b/src/core/dbus-mount.c index c683b36c4c..69a04fe2ae 100644 --- a/src/core/dbus-mount.c +++ b/src/core/dbus-mount.c @@ -36,7 +36,7 @@ static int property_get_what( sd_bus_error *error) { Mount *m = userdata; - const char *d; + const char *d = NULL; assert(bus); assert(reply); @@ -46,8 +46,6 @@ static int property_get_what( d = m->parameters_proc_self_mountinfo.what; else if (m->from_fragment && m->parameters_fragment.what) d = m->parameters_fragment.what; - else - d = ""; return sd_bus_message_append(reply, "s", d); } @@ -62,7 +60,7 @@ static int property_get_options( sd_bus_error *error) { Mount *m = userdata; - const char *d; + const char *d = NULL; assert(bus); assert(reply); @@ -72,8 +70,6 @@ static int property_get_options( d = m->parameters_proc_self_mountinfo.options; else if (m->from_fragment && m->parameters_fragment.options) d = m->parameters_fragment.options; - else - d = ""; return sd_bus_message_append(reply, "s", d); } |