-/***
- This file is part of systemd.
-
- Copyright 2017 Dmitry Rozhkov
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
#include "conf-files.h"
#include "conf-parser.h"
"/etc/systemd/dnssd",
"/run/systemd/dnssd",
"/usr/lib/systemd/dnssd",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
"/lib/systemd/dnssd",
#endif
NULL
static const Specifier specifier_table[] = {
{ 'b', specifier_boot_id, NULL },
{ 'H', specifier_dnssd_host_name, NULL },
- { 'm', specifier_machine_id, NULL },
+ { 'm', specifier_machine_id, NULL },
{ 'v', specifier_kernel_release, NULL },
{}
};
if (r < 0)
return log_debug_errno(r, "Failed to replace specifiers: %m");
- if (!dns_service_name_is_valid(name)) {
- log_debug("Service instance name '%s' is invalid.", name);
- return -EINVAL;
- }
+ if (!dns_service_name_is_valid(name))
+ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Service instance name '%s' is invalid.",
+ name);
- *ret_name = name;
- name = NULL;
+ *ret_name = TAKE_PTR(name);
return 0;
}
}
i->length = length;
- *ret_item = i;
- i = NULL;
+ *ret_item = TAKE_PTR(i);
return 0;
}
}
i->length = length;
- *ret_item = i;
- i = NULL;
+ *ret_item = TAKE_PTR(i);
return 0;
}