From: Yu Watanabe Date: Sun, 26 Sep 2021 10:53:00 +0000 (+0900) Subject: hostname-util: introduce get_pretty_hostname() X-Git-Tag: v250-rc1~613^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3daf7010147f986780b26046096dd4dc97602038;p=thirdparty%2Fsystemd.git hostname-util: introduce get_pretty_hostname() --- diff --git a/src/basic/hostname-util.h b/src/basic/hostname-util.h index 28975c87920..0d1574db9e3 100644 --- a/src/basic/hostname-util.h +++ b/src/basic/hostname-util.h @@ -4,6 +4,7 @@ #include #include +#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); +}