"PRETTY_NAME", &c->data[PROP_OS_PRETTY_NAME],
"CPE_NAME", &c->data[PROP_OS_CPE_NAME],
NULL);
+ if (r == -ENOENT) {
+ r = parse_env_file("/usr/lib/os-release", NEWLINE,
+ "PRETTY_NAME", &c->data[PROP_OS_PRETTY_NAME],
+ "CPE_NAME", &c->data[PROP_OS_CPE_NAME],
+ NULL);
+ }
+
if (r < 0 && r != -ENOENT)
return r;
}
static bool hostname_is_useful(const char *hn) {
- return !isempty(hn) && !streq(hn, "localhost");
+ return !isempty(hn) && !is_localhost(hn);
}
static int context_update_kernel_hostname(Context *c) {
assert(c);
- r = load_env_file("/etc/machine-info", NULL, &l);
+ r = load_env_file(NULL, "/etc/machine-info", NULL, &l);
if (r < 0 && r != -ENOENT)
return r;