hostnamectl: show hint when user try to set transient hostname but static hostname is already used

This commit is contained in:
Yu Watanabe
2021-02-09 13:49:27 +09:00
parent e8acf09186
commit f2d3ec7abf
3 changed files with 33 additions and 5 deletions
+1 -1
View File
@@ -233,4 +233,4 @@ static const char* const hostname_source_table[] = {
[HOSTNAME_FALLBACK] = "fallback",
};
DEFINE_STRING_TABLE_LOOKUP_TO_STRING(hostname_source, HostnameSource);
DEFINE_STRING_TABLE_LOOKUP(hostname_source, HostnameSource);
+3 -1
View File
@@ -11,7 +11,9 @@ typedef enum HostnameSource {
_HOSTNAME_INVALID = -1,
} HostnameSource;
const char* hostname_source_to_string(HostnameSource source);
const char* hostname_source_to_string(HostnameSource source) _const_;
HostnameSource hostname_source_from_string(const char *str) _pure_;
int sethostname_idempotent(const char *s);
int shorten_overlong(const char *s, char **ret);