summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0xAX <0xAX@users.noreply.github.com>2016-08-22 09:14:23 +0300
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-08-22 02:14:23 -0400
commit05b4d3b55c0a60aa17817d51129f2bc83914c1f4 (patch)
tree9e1672b4da1364568f2d26aed8066a36c0207545
parentdf35bfaa25f8bda7953d922c73c5fd0242089fe6 (diff)
mount-tool: return 0 instead of NULL in the acquire_description() (#4009)
to prevent: src/mount/mount-tool.c: In function ‘acquire_description’: src/mount/mount-tool.c:728:24: warning: return makes integer from pointer without a cast [-Wint-conversion] return NULL; ^~~~ warning. Additionally we don't set Description property in a case when arg_description is NULL.
-rw-r--r--src/mount/mount-tool.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c
index 9076ba3b0b..80bba086e4 100644
--- a/src/mount/mount-tool.c
+++ b/src/mount/mount-tool.c
@@ -319,9 +319,11 @@ static int parse_argv(int argc, char *argv[]) {
static int transient_unit_set_properties(sd_bus_message *m, char **properties) {
int r;
- r = sd_bus_message_append(m, "(sv)", "Description", "s", arg_description);
- if (r < 0)
- return r;
+ if (!isempty(arg_description)) {
+ r = sd_bus_message_append(m, "(sv)", "Description", "s", arg_description);
+ if (r < 0)
+ return r;
+ }
if (arg_bind_device && is_device_path(arg_mount_what)) {
_cleanup_free_ char *device_unit = NULL;
@@ -725,7 +727,7 @@ static int acquire_description(struct udev_device *d) {
else if (model)
arg_description = strdup(model);
else
- return NULL;
+ return 0;
if (!arg_description)
return log_oom();