summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-30 17:59:43 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-30 17:59:43 +0200
commit3c6f7c340237262b560586cf7cf06be957d4352f (patch)
tree6eb58f6d2ef4843256139d939dbcbc91da40734c /src/resolve
parentc6f8d17de0c36f94213496e2c9fd013f113ebe08 (diff)
downloadsystemd-3c6f7c340237262b560586cf7cf06be957d4352f.tar.gz
util-lib: make localed's nonempty() generic, rename it to empty_to_null() and make use of it everywhere
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolve-tool.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c
index 14ee01c49d..7e145c64c4 100644
--- a/src/resolve/resolve-tool.c
+++ b/src/resolve/resolve-tool.c
@@ -658,10 +658,8 @@ static int resolve_service(sd_bus *bus, const char *name, const char *type, cons
assert(bus);
assert(domain);
- if (isempty(name))
- name = NULL;
- if (isempty(type))
- type = NULL;
+ name = empty_to_null(name);
+ type = empty_to_null(type);
if (arg_ifindex > 0 && !if_indextoname(arg_ifindex, ifname))
return log_error_errno(errno, "Failed to resolve interface name for index %i: %m", arg_ifindex);
@@ -820,10 +818,8 @@ static int resolve_service(sd_bus *bus, const char *name, const char *type, cons
if (r < 0)
return bus_log_parse_error(r);
- if (isempty(canonical_name))
- canonical_name = NULL;
- if (isempty(canonical_type))
- canonical_type = NULL;
+ canonical_name = empty_to_null(canonical_name);
+ canonical_type = empty_to_null(canonical_type);
if (!streq_ptr(name, canonical_name) ||
!streq_ptr(type, canonical_type) ||