mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
hostname-util: introduce get_pretty_hostname()
This commit is contained in:
parent
3be1e84fe9
commit
3daf701014
@ -4,6 +4,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "env-file.h"
|
||||
#include "macro.h"
|
||||
#include "strv.h"
|
||||
|
||||
@ -60,3 +61,7 @@ static inline bool is_outbound_hostname(const char *hostname) {
|
||||
/* This tries to identify the valid syntaxes for the our synthetic "outbound" host. */
|
||||
return STRCASE_IN_SET(hostname, "_outbound", "_outbound.");
|
||||
}
|
||||
|
||||
static inline int get_pretty_hostname(char **ret) {
|
||||
return parse_env_file(NULL, "/etc/machine-info", "PRETTY_HOSTNAME", ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user